• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Hoe to remove Comments count from entry header

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Hoe to remove Comments count from entry header

This topic is: resolved
  • This topic has 11 replies, 3 voices, and was last updated 7 years, 4 months ago by Brad Dalton.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • November 13, 2015 at 12:20 pm #171022
    Dan Merry
    Participant

    Hello 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 #171035
    Brad Dalton
    Participant

    Add this code to your functions file and remove the post comments shortcode. http://my.studiopress.com/snippets/entry-header/#customize


    Tutorials for StudioPress Themes.

    November 13, 2015 at 3:58 pm #171047
    Dan Merry
    Participant

    Thanks 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 #171050
    Brad Dalton
    Participant

    Leave 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;
    }
    

    Tutorials for StudioPress Themes.

    November 14, 2015 at 1:18 pm #171101
    Mike
    Member

    For 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 #171131
    Dan Merry
    Participant

    Thank 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 #171149
    Brad Dalton
    Participant

    Do you also have the Genesis Simple Edits plugin installed?


    Tutorials for StudioPress Themes.

    November 15, 2015 at 1:46 pm #171194
    Mike
    Member

    I 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 #171198
    Brad Dalton
    Participant

    Just 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.


    Tutorials for StudioPress Themes.

    November 15, 2015 at 2:40 pm #171212
    Dan Merry
    Participant

    Thank you very much guys, your help is appreciated. Finally I resolved using the plugin.
    Thanks again 🙂

    November 15, 2015 at 3:36 pm #171214
    Mike
    Member

    Thanks 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 #171215
    Brad Dalton
    Participant

    Thanks Mike!


    Tutorials for StudioPress Themes.

  • Author
    Posts
Viewing 12 posts - 1 through 12 (of 12 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2023 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble