Skip to content

Instantly share code, notes, and snippets.

@miklb
Created January 27, 2018 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miklb/dee0edc9aa75693e27f7a0cc88e16a06 to your computer and use it in GitHub Desktop.
Save miklb/dee0edc9aa75693e27f7a0cc88e16a06 to your computer and use it in GitHub Desktop.
Wrap $content in e-content
/**
* Wraps the_content in e-content
*
*/
function mf2_s_the_content( $content ) {
if ((mf2_s_template_type()=='article')||(is_page())) {
$wrap = '<div class="entry-content e-content"><p>';
}
else {
$wrap = '<div class="entry-content e-content p-name"><p>';
}
if ($content!="") {
return $wrap . $content . "\n" . '</div>' . '<!-- .entry-content -->';
}
return $content;
}
add_filter( 'the_content', 'mf2_s_the_content', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment