Skip to content

Instantly share code, notes, and snippets.

@guilhermealveslopes
Created April 25, 2017 22:06
Show Gist options
  • Save guilhermealveslopes/503f68105bb2402012dc1764eb663807 to your computer and use it in GitHub Desktop.
Save guilhermealveslopes/503f68105bb2402012dc1764eb663807 to your computer and use it in GitHub Desktop.
Append content after the_content Wordpresss
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