These code snippets enable you to remove specific links generated by shortcodes from the default post info and post meta output.
The code includes conditional tags which you can change and shortcodes which you can remove.
Please copy ALL the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++
Post Info
This code only removes the comments link from all posts in category 1 on both the single post page and archive pages.
Post Meta
This code only removes the tagged with link from all posts in category 1 on both the single post page and archive pages.
Note: The code may NOT work if you have the Genesis Simple Edits plugin enabled as it can over ride any custom functions.
perfect thanks Brad!
Sorry code should be:
add_filter( 'genesis_post_info', 'wpsites_remove_post_info_conditionally' );
function wpsites_remove_post_info_conditionally($post_info) {
if ( in_category('wiley') ) :
$post_info = ' by Brad Dalton ';
return $post_info;
else:
$post_info = ' by Brad Dalton 7 Comments ';
return $post_info;
endif;
}
not sure why it’s adding your info in the post info variables, seems to be happening when I try to paste in the code…
Hi
Should be:
Hi Brad,
I was hoping the first snippet would remove the post author name, date and ‘post a comment’ stuff (underneath the post title on single posts) only for posts in a particular category.
In my case, my category name is ‘wiley’ so I did:
Doesn’t seem to be working, wondering what I’m doing wrong…
Hi Brad!
Your tutorials are simply awesome. I have customized my Genesis website by following your tutorials. You simply rock. Thanks for helping me in Genesis customization.
You’re welcome Sarah.