• 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

Changing Leave a Comment under Archive Only?

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 › Changing Leave a Comment under Archive Only?

This topic is: not resolved

Tagged: custom post type archive template, leave a comment

  • This topic has 2 replies, 2 voices, and was last updated 12 years, 11 months ago by Scott Buehler.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • January 4, 2013 at 2:33 pm #9561
    Scott Buehler
    Member

    I've had a lot of success using functions.php snippets directly in the single-cpt.php file.

    However, under archive-cpt.php I am trying to modify "Leave a Comment" and the below snippet isn't working:

    /** Modify the comment link text */
    add_filter( 'genesis_post_meta', 'post_meta_filter' );
    function post_meta_filter( $post_meta ) {
    return '[post_comments zero="Leave a Review" one="1 Review" more="% Reviews"]';
    }

    What should be changed to get it to work on my CPT archive page?


    TygrScott on Social Media

    January 5, 2013 at 9:04 pm #9857
    Chris Cree
    Participant

    Instead of adding it to your post type files, put something like this in your functions.php file:

    /** Modify the comment link text */
    add_filter( 'genesis_post_meta', 'post_meta_filter' );
    function post_meta_filter( $post_meta ) {
    	if ( is_singular( 'custom-post-type' ) {
    		return '[post_comments zero="Leave a Review" one="1 Review" more="% Reviews"]';
    	}
    	else return '[post_comments zero="No Comments" one="1 Comment" more="% Comments"]';
    }

    Change out custom-post-type with the actual custom post type you want it to apply to. See is_singluar() in the WP Codex.

    January 6, 2013 at 12:24 am #9900
    Scott Buehler
    Member

    Hmm none of that is working.

    Even if I use this code directly in my functions.php and change "Leave a Comment" to "asdasdsadsadasd" it doesn't change on my main page, blog page, or anywhere. That's weird.

    I read Nick on the other read only forum ask if they have Simple Edits installed. I did. I deactivated it, removed footer completely in functions.php, and uninstalled it (not needed now). Footer is removed and still the code snippet isn't modifying the "Leave a comment" to "asdasdsadasdad" on posts with 0 comments.


    TygrScott on Social Media

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 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

© 2025 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