[Resolved] Gravatar and comments to post meta

Home Forums Support Gravatar and comments to post meta

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #827008
    Sumit

    I want author gravator, no. of comments, and last updated date below my post title in the blog page.

    Please check the screenshot. (I want the same thing)

    Screenshot URL: https://drive.google.com/file/d/1guKIeAsJ0J8Uzvck5YDGZEYgTrd5q6dA/view?usp=sharing

    please provide me custom css

    GeneratePress 2.2.2
    #827438
    David
    Staff
    Customer Support

    Hi there,

    the Snippet Tom provides here will do that:

    https://generatepress.com/forums/topic/how-to-show-updated-posts-with-plugin/#post-827017

    As a note we try to provide answers to all support tickets within 24hrs, it generally is a lot quicker then that. It may also be beneficial if you added Topic Titles that we’re relevant to the to topic, it makes it easier for us and you to find the topic help you need.

    #827467
    Sumit

    I added those code in the custom CSS field but it was showing error.

    Please tell me where to add those code.

    Waiting for your reply.

    #827474
    David
    Staff
    Customer Support

    The code is PHP – this article covers 2 methods of adding:

    https://docs.generatepress.com/article/adding-php/

    #827508
    Sumit

    I’ve added the PHP code but size of gravator is to big and it’s in the square shape.

    I want the author gravatar size and shape (i.e. round shape) same as https://masterblogging.com/blog/

    I also want to add separator “|” between name, no. of comments and last updated date. (same as above blog)

    I have added this code in my site:

    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' ) )
    		)
    	);
    
    	if ( ! is_single() && ! 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>';
    	}
    
    	$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() )
    	);
    
    	return sprintf( '<span class="posted-on">%s</span>', // WPCS: XSS ok, sanitization ok.
    		$time_string
    	);
    }

    please give me a modified code.

    I’m waiting…

    #827542
    Tom
    Lead Developer
    Lead Developer
    #827580
    Sumit

    Thanks a lot Tom.

    I’m facing these two problems.

    1) In the right sidebar of my blog (https://blogginglift.com/blog/), the 1st widget background colour is orange. (all the time)
    How to fix this problem.

    2) I’m using post excerpt option in GeneratPress theme. and with this option, I want to show a full-width featured image thumbnail in my blog section. How to do it?

    Thanks in advance.

    #827588
    Leo
    Staff
    Customer Support

    Please open a new topic(s) for the separate questions.

    Thanks!

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.