Remove Post Info, Meta from home but show on single post
Updated On May 23, 2015 September 21, 2012 -Written ByMajority of Genesis child themes display post info and post meta on homepage as well as single post pages. Few users may want to remove (or hide) the post info and post meta from the homepage of the blog but still show on the single post pages. You can easily remove post info and post meta sections from homepage except single post page using following code.
What is post info and post meta in Genesis
Post info section display information about specific post like: publishing date, author name and number of comments. While Post meta display ‘Filed Under’ categories and ‘Tageed With’ tags of every post.
Remove Post Info, Meta on home & show on single post
Add following code to functions.php file:
[cc]
// remove post meta post info – basicWP.com
remove_action(‘genesis_after_post_content’, ‘genesis_post_meta’);
remove_action(‘genesis_before_post_content’, ‘genesis_post_info’);
add_action(‘template_redirect’, ‘child_conditional_actions’);
function child_conditional_actions() {
if( is_single() ) {
add_action(‘genesis_after_post_content’, ‘genesis_post_meta’);
add_action(‘genesis_after_post_content’, ‘genesis_post_info’);
}}
[/cc]
Adding that just break my site :-(
Sorry, it worked but it removes the post info from Single not from the Home Page !!!
Checked again, above code should remove post info and meta from homepage and display on single post page.
You may get error, if your functions.php file already has “child_conditional_actions” for some other code. Just rename it to something else like “‘child_conditional_actions_one” at two places in the above and this should work fine.
It just didn`t work at all. :(
It worked, I was using a plugin that was in conflict with your code. thank you.
Thank you, this worked great!