Support

Account

Home Forums General Issues Add a lot of custom fields to the_content Reply To: Add a lot of custom fields to the_content

  • Do you want all of the div you posted to be inserted into the div that holds the content? Yes you could do this here. For example you can use output buffering to enclose the content and then add it like this

    
    add_filter( 'the_content', 'my_the_content_filter', 0 );
    function my_the_content_filter( $content ) {
        if (is_single()) {
            global $post;
            $pgLnk=get_post_meta($post->ID, 'Button', true);
            ob_start();
            ?>
                <div class="row"> 
                  ... and the rest of the html
                  ... and field you want to add to content
            <?php 
            $content .= ob_get_clean();
        }
        return $content;
    }