• 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

Comments Link Code Snipped

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 › Comments Link Code Snipped

This topic is: not resolved

Tagged: code snippets, comments

  • This topic has 5 replies, 2 voices, and was last updated 10 years, 9 months ago by Brad Dalton.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • April 20, 2015 at 6:32 am #148518
    DorisEdwards
    Member

    Hello,
    I am running Minimum Pro and wanted to change the "Leave a comment" link text.
    I have this code snippet which I duly copied as is, to modify the syntax "Leave a comment".
    It seems to have an error because my function file no longer works when I paste it. NB: I have not changed anything to start with. Simply pasting the code gives me the error.
    Anyone can spot the error?
    Thank you. Kind regards, Doris

    //* Modify the comment link text in comments
    add_filter( 'genesis_post_info', 'sp_post_info_filter' );
    function sp_post_info_filter( $post_info ) {
    return '[post_comments zero="Leave a Comment" one="1 Comment" more="% Comments"]';
    }

    http://www.soyouwantachange.com
    April 20, 2015 at 7:05 am #148519
    Brad Dalton
    Participant

    Make sure you copy it from the view raw link and paste it at the end of your child themes functions file using a code editor.

    When you paste PHP code into a webpage like you have done without embedding correctly, it will break when someone copies and pastes it into a file.


    Tutorials for StudioPress Themes.

    April 20, 2015 at 7:52 am #148526
    DorisEdwards
    Member

    Thank you Brad for getting back to me so quickly.
    I have indeed copied the raw version. I am not on my first code snippet, working with Genesis for nearly 5 years. I've used several today, always with the same procedure. This particular one was copied at the end of the function.php with raw.
    Unless I am mistaken, there might be a problem with the code?
    Anyway, thank you very much. Kind regards from Geneva Switzerland. Doris

    PS
    I will try copying it raw once more, pasting into an HTML Editor first, and then recopying pasting it into the function php. But I usually do not need to do that.

    April 20, 2015 at 7:54 am #148527
    Brad Dalton
    Participant

    You use a code editor to add it directly to the file rather than the theme editor right?


    Tutorials for StudioPress Themes.

    April 20, 2015 at 8:16 am #148528
    DorisEdwards
    Member

    The snippet is the Comment Link
    a) I copied (raw)
    b) pasted into html editor
    c) copied from there
    d) pasted into php function at the very end, see image

    The site is no longer accessible and I need to recopy (via FTP) the original function.php

    This is how it looks when copied from html editor

    //* Modify the comment link text in comments
    add_filter( 'genesis_post_info', 'sp_post_info_filter' );
    function sp_post_info_filter( $post_info ) {
    return '[post_comments zero="Leave a Comment" one="1 Comment" more="% Comments"]';
    }

    Kind regards, Doris

    April 20, 2015 at 8:21 am #148529
    Brad Dalton
    Participant

    No. Thats why it breaks. Copy it from the view raw link in the Gist and paste it at the end of the file using a code editor.

    Do not paste it into your WordPress > Appearance > Theme Functions > functions.php file

    Access your functions file using File Manager in cPanel or FTP.

    The PHP code that you keep on pasting into this forum breaks as previously advised.


    Tutorials for StudioPress Themes.

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

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