[Resolved] Comment Count on Meta Not Showing After 2.4 Update

Home Forums Support Comment Count on Meta Not Showing After 2.4 Update

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1075562
    Willya

    Hi, after updating my GP theme to 2.4, the comment count on single post meta is dissapear. Please help me.

    This is my script:

    add_filter( 'generate_post_author', '__return_false' );
    add_filter( 'generate_show_comments', '__return_false' );
    add_filter( 'generate_post_date_output', 'tu_fancy_byline' );
    function tu_fancy_byline( $date ) {
    	printf( ' <span class="byline">%1$s</span>',
    		sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author">%4$s<a href="%1$s" title="%2$s" rel="author"><span class="author-name" itemprop="name">%3$s</span></a></span>',
    			esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ),
    			esc_attr( sprintf( __( 'View all posts by %s', 'generatepress' ), get_the_author() ) ),
    			esc_html( get_the_author() ),
    			get_avatar( get_the_author_meta( 'ID' ) )
    		)
    	);
    	
    	$time_string = '<time class="entry-date published" datetime="%1$s" itemprop="datePublished">%2$s</time>';
    	
    	if ( get_the_time( 'U' ) !== get_the_modified_time( 'U' ) ) {
    		$time_string = '<time class="updated" datetime="%3$s" itemprop="dateModified">%4$s</time>';
    	}
    	
    	$time_string = sprintf( $time_string,
    		esc_attr( get_the_date( 'c' ) ),
    		esc_html( get_the_date() ),
    		esc_attr( get_the_modified_date( 'c' ) ),
    		esc_html( get_the_modified_date() )
    	);
    
    	printf( '<span class="posted-on">%s</span>', // WPCS: XSS ok, sanitization ok.
    		$time_string
    	);
    
    	if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
    		echo '<span class="comments-link">';
    			comments_popup_link( __( 'Leave a comment', 'generatepress' ), __( '1 Comment', 'generatepress' ), __( '% Comments', 'generatepress' ) );
    		echo '</span>';
    	}
    
    }
    #1075952
    David
    Staff
    Customer Support

    Hi there,

    can you clear and disable the Autoptimize cache so i can take a look

    #1075957
    Willya

    Hi David,

    Okay, I have disable the Autoptimize plugin and clear the cache.

    #1076066
    David
    Staff
    Customer Support

    Odd – can you try adding this CSS:

    .single .comments-link {
        display: inline-block !important;
    }
    #1076115
    Willya

    Wow it work! Thanks for rescue me again, David.

    #1076360
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.