Skip to content
WJunction - Webmaster Forum

Wordpress if condition for category single post

Status
Not open for further replies.

Gon

Experienced Member
582
2014
159
I trying to add something for selected category single post. Here is the code i tried
PHP:
<?php if (is_single() && in_category(array('category id')))
{  echo 'here is content'; }
?>
i even tried category name as well, but did not work.
 
Last edited:

2 comments

Status
Not open for further replies.

About the author

G
Experienced Member · Joined
582
Messages
159
Reactions
171
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