Archived topic
Change single post layout - .entry-meta and social media container
5 replies · Started by vikingruler on June 24, 2018
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.
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?
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.
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;
}
Hello Tom,
This worked 100%. Thank you very much for your time.
I resolved part 2 of my original ticket.
Cheers
Awesome, glad I could help! :)