[Resolved] Change single post layout – .entry-meta and social media container

Home Forums Support [Resolved] Change single post layout – .entry-meta and social media container

Home Forums Support Change single post layout – .entry-meta and social media container

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #607311
    andrachans

    Hello there,

    Can you please help me to do the following:

    On a single post:

    1) Align .cat-links with .entry-meta at the top of the page, and change the layout to look exactly like the .wp-show-posts-entry-meta layout, which in my case looks like this: Kallad Health | June 18, 2018 | Diets & Weight Loss, The 2 Week Diet

    2) Move social media container above the image, and position just under the .entry meta

    Thank you.

    #607567
    Leo
    Staff
    Customer Support

    Hi there,

    1. Can you try this solution here first: https://generatepress.com/forums/topic/social-media-icons/#post-575474

    2. How are you adding them currently?

    #607593
    andrachans

    Hello Leo,

    Thank you for getting back to me.

    1) Yes, this is pretty close.

    This what I now have:
    June 21, 2018 by Kallad HealthCategories Diets & Weight Loss, The 2 Week Diet | Tags summer, women

    This is what I am after:
    Kallad Health | June 21, 2018 | Diets & Weight Loss, The 2 Week Diet

    Unfortunately, I am not too good with coding, otherwise I would work on the code you sent me to get this sorted out.

    Can you please do the following:
    – remove these 3 words: ‘by’ and ‘Categories’ and ‘Tags’
    – Arrange in this order: Kallad Health ‘vertical line’ Date, Year ‘vertical line’ (The rest should all be fine then).

    The css seems to sort out the spacing okay.
    However, after uploading the css to style.css in the child theme, I see this error: ‘The universal selector (*) is known to be slow’. Is this a cause for concern?

    2) I am using the Super Socializer plugin.

    When I tick ‘Top of the content’ (Position with respect to content) for posts, within the plugin options, the social sharing icons automatically display in the area just beneath the image.

    I would like the social sharing icons to display above the image, and just beneath the .entry meta information.

    Thank you.

    #607748
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Can you try this instead?:

    add_filter( 'generate_post_author_output', 'tu_categories_to_author' );
    add_filter( 'generate_category_list_output', '__return_false' );
    add_filter( 'generate_tag_list_output', '__return_false' );
    add_filter( 'generate_show_comments', '__return_false' );
    add_filter( 'generate_post_date_output', '__return_false' );
    function tu_categories_to_author( $output ) {
        $categories_list = get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) );
        $categories_list = sprintf( '<span class="cat-links">%1$s</span>',
            $categories_list
        );
    	
    	$tags_list = get_the_tag_list( '', _x( ', ', 'Used between list items, there is a space after the comma.', 'generatepress' ) );
    	$tags_list = sprintf( '<span class="tags-links">%1$s</span>',
    		$tags_list
    	);
    
    	$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;
    	}
    	
    	$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() )
    	);
    
    	$date = sprintf( '<span class="posted-on">%1$s</span>', // WPCS: XSS ok, sanitization ok.
    		sprintf( '<a href="%1$s" title="%2$s" rel="bookmark">%3$s</a>',
    			esc_url( get_permalink() ),
    			esc_attr( get_the_time() ),
    			$time_string
    		)
    	);
    
    	echo $output . ' | ' . $date . ' | ' . $categories_list . ' | ' . $tags_list;
    
    }
    #607816
    andrachans

    Hello Tom,

    This worked 100%. Thank you very much for your time.

    I resolved part 2 of my original ticket.

    Cheers

    #608056
    Tom
    Lead Developer
    Lead Developer

    Awesome, glad I could help! 🙂

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