Created
January 27, 2018 15:24
-
-
Save miklb/dee0edc9aa75693e27f7a0cc88e16a06 to your computer and use it in GitHub Desktop.
Wrap $content in e-content
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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