Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to remove tags from posts only on the home & archives + other meta questions
Tagged: entry-meta
- This topic has 8 replies, 2 voices, and was last updated 8 years, 6 months ago by ceelynxo.
-
AuthorPosts
-
July 12, 2016 at 8:37 pm #189363ceelynxoMember
Hi everyone. I can't seem to figure out how to remove tags from posts showing on the homepage. I want them on the individual posts but just not the home & archives. All the tutorials I've found online shows how to just flat out remove them. Also I was wondering is there a way to customize what meta info I want in the entry header & footer... Ideally, I would like categories in the header, and the date, byline, and comment count in the footer. Thanks in advance ♥
http://test.simplyzaspy.com/July 12, 2016 at 9:19 pm #189366Brad DaltonParticipantJuly 12, 2016 at 10:14 pm #189369ceelynxoMemberThank you Braddalton, I was able to get the homepage meta just the way I wanted, but when I added the footer meta code with the conditions
//* Customize the entry meta in the entry footer (requires HTML5 theme support) add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) {if ( is_front_page() && is_home() ) { $post_meta = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]'; return $post_meta; }}
It made the homepage perfect but took away the footer meta of the single posts & pages... how can I get them back without affecting the homepage?? I tried adding another set of conditions for pages & single posts using the following code but I got an error and had to upload my back-up functions page
//* Customize the entry meta in the entry footer (requires HTML5 theme support) add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) {if (is_single () && is_page() ) { $post_meta = '[post_date] by [post_author_posts_link] [post_comments] [post_edit] [post_tags]'; return $post_meta; }}
July 13, 2016 at 12:13 am #189377Brad DaltonParticipantActually, you can use the code like this:
$post_meta = '[post_edit]';
You just need to get the conditionals right.
Or
You can use the code to remove the entry meta with conditional tags in a custom function.
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
Always use a code editor and FTP or File Manager in cPanel.
So thats 2 ways to do it.
July 13, 2016 at 12:46 am #189379ceelynxoMemberYou've completely lost me lol. Do I add the first code you showed by itself and just add it in addition to my customized homepage codes I just added? I tried it and got the syntax error... I also tried adding the same footer meta I added for the homepage, but without conditions and that didn't work either.
July 13, 2016 at 1:43 am #189382Brad DaltonParticipantUse these:
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
Here's the code snippets page
July 13, 2016 at 1:29 pm #189414ceelynxoMemberokay so I added the lines you suggested and it didn't give me error message (thankfully) but it didn't fix my problem either 🙁 My posts & pages still don't have an entry footer... Maybe you can see what I'm doing wrong, here's all the custom code I've added to my functions:
//* Customize the entry meta in the entry header (requires HTML5 theme support) add_filter( 'genesis_post_info', 'sp_post_info_filter' ); function sp_post_info_filter($post_info) { $post_info = '[post_categories before="Filed Under: "]'; return $post_info; } //* Customize the entry meta in the entry footer (requires HTML5 theme support) add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) {if ( is_front_page() && is_home() ) { $post_meta = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]'; return $post_meta; }} remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
July 13, 2016 at 2:15 pm #189417Brad DaltonParticipantI've spent over 2 hours working on this.
Here's the code to move the entry meta from the footer to the entry header and also reposition the entry meta from the entry header to entry footer.
And here's the code for removing all the entry meta globally excluding single posts.
July 13, 2016 at 4:22 pm #189425ceelynxoMemberHey Brad, unfortunately that didn't work for me either. I ended up with meta in the header and footer , BUT, I kept playing around with it and I came across one of your tutorials on removing seo-titles conditionally, and it didn't help me either lol but the endif you used in the end, reminded me of a tag I would someitmes see when looking through php files, 'elseif'... I did some reading up on how to use elseif and long story short I FIXED IT!! 😀 😀 this is the code I ended up using,
//* Customize the entry meta in the entry header (requires HTML5 theme support) add_filter( 'genesis_post_info', 'sp_post_info_filter' ); function sp_post_info_filter($post_info) { $post_info = '[post_categories before="Filed Under: "]'; return $post_info; } //* Customize the entry meta in the entry footer (requires HTML5 theme support) add_filter( 'genesis_post_meta', 'sp_post_meta_filter' ); function sp_post_meta_filter($post_meta) {if ( is_front_page() && is_home() ) { $post_meta = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]'; return $post_meta; } elseif ( is_single() ) {$post_meta = '[post_date] by [post_author_posts_link] [post_comments] [post_tags] [post_edit]'; return $post_meta; }}
It gave me just what I wanted!! Thank you so much for your help and for being patient with me!
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.