• 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

Remove comment-meta div from comments section

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 › Remove comment-meta div from comments section

This topic is: resolved

Tagged: comments, functions.php, html

  • This topic has 6 replies, 3 voices, and was last updated 10 years, 1 month ago by deconq.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • December 27, 2012 at 7:45 pm #7822
    deconq
    Member

    I want to delete the comment-meta div that displays the comment date. I know this can be easily done with CSS display:none, but Google has been fetching dates from the comments section on my Pages and adding them into its search results, which is OK for my Posts but not for my Pages. I therefore want to know how to fully delete the comment-meta div from the HTML of my pages, not just hide it with CSS. Thanks.

    December 28, 2012 at 5:14 pm #8026
    Riavon
    Member

    Under Genesis / Theme settings scroll down to where you see "Comments and Trackbacks" and untick Enable Comments for Pages.


    Twitter: @riavonentprises

    December 29, 2012 at 12:30 am #8093
    deconq
    Member

    I don't understand how you can get 'I want to turn off comments' from what I wrote. That's not what I asked and you would understand that if you read my question carefully.

    What I want to do is delete the comment dates.

    December 29, 2012 at 8:42 am #8130
    Riavon
    Member
    This reply has been marked as private.
    December 29, 2012 at 9:20 am #8136
    nickthegeek
    Member

    Sorry for the confusion on this. Sometimes it takes a bit of back and forth to make sure your issue is clearly understood, especially with something that has a very complicated answer.

    Seriously, this customization is one of the more advanced ones. You will need to make a custom comment callback. Start by opening the genesis/lib/structure/comments.php file. You won't be editing the file but you need some of the code from there.

    You also need to open the child theme functions.php file. Because of the nature of this you should probably use FTP to open the files involved.

    Add this to the child theme file

    add_filter( 'genesis_comment_list_args', 'child_comment_list_args' );
    function child_comment_list_args( $args ) {
        $args['callback'] = 'child_comment_callback';
    
        return $args;
    }
    

    This changes the "callback" for the comment list so now it is looking for the child_comment_callback function to process the comment list output. You will need to make this function. In the genesis/lib/structure/comment.php file find the "genesis_comment_callback" function and copy the entire function into your child theme functions.php file.

    In the child theme file, rename that function to child_comment_callback and edit it to remove the comment date output or make that conditional for !is_page() and make any other changes you wish to make.

    After you are finished save the changes you made to the functions.php file.

    December 29, 2012 at 5:41 pm #8239
    deconq
    Member

    Nick: Thanks for your help and your time, I'm going to implement what you've said and hope it works. 🙂

    December 29, 2012 at 6:11 pm #8247
    deconq
    Member

    Worked perfectly.

  • Author
    Posts
Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Remove comment-meta div from comments section’ is closed to new 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