Created
February 22, 2013 06:07
-
-
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
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
<?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