I have a custom post type called 'Courses' and a bunch of posts within custom taxonomies.
I need to be able to display a different widget on each individual post under Courses.
I have widget logic plugin installed and it works fine for things like is_page() is_single() etc...
What must I use to target specific posts. If a post has an id of 202 what conditional statement do I need to use?
or is there a better way to do it?
Kannan C answers:
Try this
is_single(array(17,18,19));
Hope it work with widget logic also.
Kannan C comments:
For more information on is_single function http://codex.wordpress.org/Function_Reference/is_single
Dan | gteh comments:
yup works.. late night. i had a typo which is why it wasn't working.
thanks
Jerson Baguio answers:
You can add a custom field in a post lets say: iswidgetenabled
answerable by yes/no in your post's custom field.
in your post page
you can use a statement like
if(get_post_meta($post->ID, 'iswidgetenabled', true)){
//display your widget shortcode here
}