Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Insert a banner to the beginning of post content
- function add_banner( $content ) {
- if( !is_single() ) {
- // Do not show banner on anything other than single post pages
- // Just leave content alone
- return $content;
- } else {
- // if it is a post and it is in category opinion... display this.
- if( in_category('opinion') ){
- $banner = '<p style="font-style:italic;">*Las opiniones expresadas en este artículo son de exclusiva responsabilidad del autor y no necesariamente representan la opinión de Grupo Nueva Prensa.</p>';
- return $banner . $content;
- }
- return $content;
- }
- }// end of function add_banner
- add_filter('the_content','add_banner');
Advertisement
Add Comment
Please, Sign In to add comment