Comment # with background, no "comments" or "Leave a comment" for 0; have code

Community Forums Forums Design Tips and Tricks Comment # with background, no "comments" or "Leave a comment" for 0; have code

This topic is: not resolved

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Susan 3 months, 1 week ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #90201

    ameeker
    Participant
    Post count: 29

    I need to show the comment # with a background (which I’ve done successfully with the first snippet below), but without the “Comments” after 1+ comments (also done with the same snippet), and with zero comments showing “0″ instead of “Leave a Comment.”

    The second snippet would let me customize that bit – but I don’t see how to put the two together. I’m almost there!

    THIS SNIPPET ALLOWS ME TO ADD THE BUBBLE BACKGROUND BEHIND THE COMMENT #
    
    add_filter( 'genesis_post_comments_shortcode', 'prefix_post_comments_shortcode' );
    /**
     * Amend the post comments shortcode to add extra markup for styling.
     *
     * @author Gary Jones
     * @link   http://gamajo.com/style-comment-number/
     *
     * @param string $output HTML markup.
     *
     * @return string HTML markup.
     */
    function prefix_post_comments_shortcode( $output ) {
        return preg_replace( '/#comments"\>(\d+) Comment/', '#comments"><span class="entry-comments-number">$1</span>', $output );
    }
    
    THIS SNIPPET ALLOWS ME TO CHANGE THE TEXT FOR COMMENTS SO ZERO = 0, ONE = 1, TWO =2
    add_filter( 'genesis_post_info', 'sp_post_info_filter' );
    function sp_post_info_filter( $post_info ) {
    	return '[post_comments zero="0" one="1" more="%"]';
    }
    
    I NEED BOTH - THE BUBBLE WITHOUT THE "COMMENTS" AFTER 1> COMMENTS, AND WITH 0 FOR ZERO COMMENTS INSTEAD OF "LEAVE A COMMENT"
    #100827

    Susan
    Moderator
    Post count: 7988

    As you posted this a while ago, I hope your issue has been resolved. If not, please check back in here, and I will troubleshoot (or escalate) as appropriate.

    If your issue has been resolved, please mark it “resolved”, so that it can be closed.

    Thanks!


    Susan @ Graphically Designing I’d love to customize your website! I tweet!
    I’ve taken up the challenge! – help me answer some of the unanswered posts

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

You must be logged in to reply to this topic.