Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: Add a Custom field in the Masonry (post/blog list) element #1341884

    Well, I have found a way to add the Custom Field to the Content part using get_post_meta & the name of my Custom Field (‘speaker’). If it can help anyone, or if anyone wants to give me input to improve it, please do :

    /*  Filter to add Custom Fields to Masonry Post list */
    add_filter("avf_masonry_entry_content", function($content, $entry, $config) {
        $speakers = get_post_meta( $entry["ID"], 'speaker', true);
        $separator = ' ';
        $output = '';
       if ( ! empty( $speakers ) ) {
            $output = '<b><em>' . esc_html( $speakers ) . '</b></em><br>';
            $content = $output . $content;
        } 
        return $content;
    }, 10, 3); 
Viewing 1 post (of 1 total)