Add something to beginning of the content

the_content is also a filter, into which the content is passed as an argument. You simply prepend your content and then return like so.

add_filter('the_content','prepend_this');

function prepend_this($content)
{
    $content = "string to prepend" . $content;
return $content

}

Leave a Comment