Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Created February 22, 2013 06:07
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 kreamweb/5011099 to your computer and use it in GitHub Desktop.
Save kreamweb/5011099 to your computer and use it in GitHub Desktop.
[Wordpress] - How use a filter in wordpress, in this case add a custom content before the content of post
<?php
function theme_slug_filter_the_content( $content ) {
$custom_content = 'YOUR CONTENT GOES HERE';
$custom_content .= $content;
return $custom_content;
}
add_filter( 'the_content', 'theme_slug_filter_the_content' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment