Before & After the_content

This is a very good code example for putting info before and after the_content:

    
function wpdev_before_after($content) {
    $beforecontent = 'This goes before the content. Isn\'t that awesome!';
    $aftercontent = 'And this will come after, so that you can remind them of something, like following you on Facebook for instance.';
    $fullcontent = $beforecontent . $content . $aftercontent;
        
    return $fullcontent;
}
add_filter('the_content', 'wpdev_before_after');

Code was taken from here.

Leave a Reply

Your email address will not be published. Required fields are marked *