Using the example in the ‘Wicked Wordpress Themes’ book, I have added the ‘linklove’ function and hook, to display the link code to all single posts
what i would like to do is exclude one post from displaying this link.
looking through the template hierarchy, do i need to set up a custom post type for this single post, in order to exclude it ?
At the moment the function is applied if(is_single()) {} equates to true.
crushfor:
Using the example in the ‘Wicked Wordpress Themes’ book, I have added the ‘linklove’ function and hook, to display the link code to all single posts
what i would like to do is exclude one post from displaying this link.
looking through the template hierarchy, do i need to set up a custom post type for this single post, in order to exclude it ?
At the moment the function is applied if(is_single()) {} equates to true.
If I understand you correctly, you want to show this link code on all but one post? If correct, just check for is_single as you’re doing and then add a second conditional statement for is_single against the post ID, slug, or title.
if(is_single() && !is_single('post-to-exlude')) {
}
Thanks Tim, that works perfectly.