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

  • I don’t know why, but don’t work, sen me a error in the } before $content .= ob_get_clean();

    i paste you here the start and the end of code

    START

       <?php add_filter( 'the_content', 'contenido_events_add', 0 );
    function contenido_events_add( $content ) {
        if ($post->post_type == 'sp-event')
            global $post;
            ob_start();
            ?>
                <div class="row"> 
                  ... and the rest of the html
                  ... and field you want to add to content

    END

    <?php 
            $content .= ob_get_clean();
        }
        return $content
    }
    
    ?>

    This don’t work but i think is near to te solution, probably if you don’t check the code I pasted before this can be whit some error.

    Thank you!