Created
April 25, 2017 22:06
-
-
Save guilhermealveslopes/503f68105bb2402012dc1764eb663807 to your computer and use it in GitHub Desktop.
Append content after the_content Wordpresss
This file contains 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
add_filter( 'the_content', 'my_the_content_filter', 0 ); | |
function my_the_content_filter( $content ) { | |
if (is_single()) { | |
global $post; | |
$meta=get_post_meta($post->ID, 'meta', true); | |
ob_start(); | |
?> | |
<div class="row"> | |
... and the rest of the html | |
... and field you want to add to content | |
<?php | |
$content .= ob_get_clean(); | |
} | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment