Quick question about adding custom content to the end of every post
-
I’ve setup my functions page with the following code which adds content to the end of every post:
function custom_post_content($content) { global $post; $permalink = get_permalink($post->ID); $title = get_the_title(); if(!is_feed() && !is_home() && !is_page()) { $content = $content . 'Yaketty smacketty'; } return $content; } add_filter('the_content', 'custom_post_content');
My question is, is there a way to only allow this custom content to appear on posts for specific categories.
I tried doing this by adding:
&& !in_category('blog')
to the mix but it does not seem to be working.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Quick question about adding custom content to the end of every post’ is closed to new replies.