Leave a Comment Text Won't Change

Community Forums Forums Design Tips and Tricks Leave a Comment Text Won't Change

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  nutsandbolts 7 months, 1 week ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #89360

    Tony
    Participant
    Post count: 5

    I’m trying to change the “leave a comment” text site wide, but the code on the Studiopress website doesn’t do anything. Here’s what I’m using:

    //* 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="0" one="1" more="%"]';
    }

    Basically, I want the output to show the numbers only.

    Any ideas? This is on the Beautiful Pro theme.

    #89430

    nutsandbolts
    Moderator
    Post count: 3131

    This tutorial walks you through several customizations for comments, including changing the “leave a comment” text: http://www.bourncreative.com/customizing-genesis-2-0-html5-comment-form/


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

    #89470

    Tony
    Participant
    Post count: 5

    Hi Andrea,

    Thank you for the resource, but unless I didn’t see it, it’s not quite what I’m looking for.

    I’m referring to the “leave a comment” link that appears in the post info section, specifically the .entry-comments-link span class.

    This is where it shows how many comments the article has. I want to change it from the default “leave a comment” when there’s zero comments to just display “0″.

    The code I posted in the original post doesn’t work, and I’m not sure why.

    #89473

    Tony
    Participant
    Post count: 5

    I was able to get the result I want by placing:

    [post_comments zero="0" one="1" more="%"]

    in the genesis_entry_header hook using the simple hooks plugin.

    It still would be nice to know how to accomplish this the right way in the functions.php file.

    #89526

    nutsandbolts
    Moderator
    Post count: 3131

    Sorry, I just realized the tutorial I linked to wasn’t even applicable to what you asked! I think I’m losing it. o_O

    Here’s how you would do the same thing with a function – try this one and see if it works:

    //* Customize the post info function
    add_filter( 'genesis_entry_header', 'sp_post_info_filter' );
    function sp_post_info_filter($post_info) {
    if ( !is_page() ) {
    	$post_info = '[post_date] by [post_author_posts_link] [post_comments zero="0" one="1" more="%"] [post_edit]';
    	return $post_info;
    }}

    Now, that long line may need to be changed depending on whether you want the date, post author, etc. to be included. Let me know how it works out and whther it needs to be modified.


    Andrea Whitmer, Owner, Nuts and Bolts Media
    I provide dev and training services for web designers • Find me on Twitter and Google+

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.