Community Forums › Forums › Archived Forums › Design Tips and Tricks › Hoe to remove Comments count from entry header
- This topic has 11 replies, 3 voices, and was last updated 7 years, 4 months ago by
Brad Dalton.
-
AuthorPosts
-
November 13, 2015 at 12:20 pm #171022
Dan Merry
ParticipantHello wonderful people of this forum.
Can you please tell me how to remove this: http://screencast.com/t/82JzELhARBW
I'm using BG Endless theme
Thank in advance for any advice.
November 13, 2015 at 2:49 pm #171035Brad Dalton
ParticipantAdd this code to your functions file and remove the post comments shortcode. http://my.studiopress.com/snippets/entry-header/#customize
November 13, 2015 at 3:58 pm #171047Dan Merry
ParticipantThanks brad, that code remove it, but it removed the author link too which I don't want to remove.
Is there a way to remove just the section of Comment Count?
Thanks again.November 13, 2015 at 4:03 pm #171050Brad Dalton
ParticipantLeave the author shortcode in there.
Only remove the post comments shortcode.
add_filter( 'genesis_post_info', 'sp_post_info_filter' ); function sp_post_info_filter($post_info) { $post_info = '[post_date] by [post_author_posts_link] [post_edit]'; return $post_info; }
November 14, 2015 at 1:18 pm #171101Mike
MemberFor those who are less code savvy, a solid solution would be the Genesis Simple Edits plugin developed by the same people who developed Genesis which contains a field titled Entry Meta (above content) where you can remove [post_comments]. I prefer Brad's solution, but for the less code-savvy folks, this works very well.
November 14, 2015 at 9:44 pm #171131Dan Merry
ParticipantThank you very much Brad!
I have this code in the funtion.php with the [post_comments] removed
//* Customize the entry meta in the entry header add_filter( 'genesis_post_info', 'sp_post_info_filter' ); function sp_post_info_filter($post_info) { $post_info = '[post_date] by [post_author_posts_link]'; return $post_info; }
But I still have the comments count in there 🙁
This is the site I'm working on if any of you want to take a look to see whats going on: http://contradicciones.wpsetup.xyz/derechos-humanos-de-los-ninos/
Thanks you Mike for your replay, I'm trying to accomplish this without a plugin.
November 15, 2015 at 7:35 am #171149Brad Dalton
ParticipantNovember 15, 2015 at 1:46 pm #171194Mike
MemberI performed a local install of BG Endless theme to test and can confirm Dan's findings. The code doesn't seem to work. I then installed & activated Genesis Simple Edits and pulled the comment shortcode and that did the trick. I know you don't want another plugin but thought I would let you know what I found.
November 15, 2015 at 2:02 pm #171198Brad Dalton
ParticipantJust tested the code and it works https://youtu.be/xYWe5xbBWh0
Cannot test on your theme as its not a StudioPress theme and don't have a copy however i think your functions file must already include a filter function using the same hook which you'll need to modify or remove.
November 15, 2015 at 2:40 pm #171212Dan Merry
ParticipantThank you very much guys, your help is appreciated. Finally I resolved using the plugin.
Thanks again 🙂November 15, 2015 at 3:36 pm #171214Mike
MemberThanks for the update Dan. And Brad, thank you for the hint! This issue is in the functions.php file on or around line 120-121 I found the following code:
$post_info = '[post_date] // [post_author_posts_link] [post_comments] [post_edit]'; return $post_info;
All you have to do is remove [post_comments]. That leaves you with the following:
$post_info = '[post_date] // [post_author_posts_link] [post_edit]'; return $post_info;
This seemed to solve the issue on my test install with the BG Endless theme.
November 15, 2015 at 3:41 pm #171215Brad Dalton
Participant -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.