Skip to content
WJunction - Webmaster Forum

Help with is_home, is_singular

Status
Not open for further replies.

keito0015

Experienced Member
999
2012
270
Code:
function add_post_content($content) {
	if(!is_feed() && !is_home()) {
		$content .= '<p>This article is copyright &copy; '.date('Y').'&nbsp;'.bloginfo('name').'</p>';
	}
	return $content;
}
add_filter('the_content', 'add_post_content');

That code shows on single post,search, categories.

how can I show this to single post only? hope you can help me with this thanks.

---------- Post added at 06:50 AM ---------- Previous post was at 06:37 AM ----------

fix it already. thread closed.

function add_after_post_content($content) {
if(!is_feed() && !is_home() && is_singular() && is_main_query()) {
$content .= '
Content that is added after the post content.
';
}
return $content;
}
add_filter('the_content', 'add_after_post_content');
 
Status
Not open for further replies.

About the author

K
Experienced Member · Joined
999
Messages
270
Reactions
63
Points
Grow your business

Advertise on WJunction

Connect with an established international community of webmasters, hosting providers, developers and online entrepreneurs.

  • Premium & Premium+ Sticky
  • Dedicated section banners
  • Site-wide banner advertising
Explore advertising options
Back
Top Bottom