- This topic has 21 replies, 2 voices, and was last updated 5 years, 1 month ago by
Leo.
-
AuthorPosts
-
February 24, 2021 at 10:53 am #1671053
Leo
StaffCustomer SupportHmm sorry I’m not sure why that would be.
Could we try using the header element solution to keep things simple?
Here is what I did.
– Add this PHP function to create a shortcode for author image:
function lh_page_hero_gravatar() { ob_start(); global $post; $author_id = $post->post_author; ?> <div class="page-hero-gravatar"> <?php echo get_avatar( $author_id ); ?> </div> <?php return ob_get_clean(); } add_shortcode( 'page_hero_gravatar', 'lh_page_hero_gravatar' );– Add this as the page hero content:
<h1>{{post_title}}</h1> <div class="entry-meta entry-meta-container"> <div class="entry-meta-gravatar"> [page_hero_gravatar] </div> <div class="entry-meta-info"> <div class="entry-meta-author"> {{post_author}} </div> <div class="entry-meta-date"> {{post_date}} </div> </div> </div>– CSS should be the same here:
https://docs.generatepress.com/article/entry-meta-style/#example-2– Result: https://www.screencast.com/t/WQ5LQ4pppL
If that fixes the gravatar issue, then we can tweak the rest with some CSS.
February 24, 2021 at 11:50 am #1671110George
No, it works perfectly as it is!
I put the CSS in, the only thing I can’t seem to fix is this small gap at the top of the featured image when inspecting the
content-areaclass. Basically, I am trying to line up the featured image top with the right sidebar top but there is this tiny top gap. Can you see it?February 24, 2021 at 7:36 pm #1671509Leo
StaffCustomer SupportTry this CSS:
.post-image-below-header.post-image-aligned-center .inside-article .featured-image { margin-top: 0; }It’s there by default to separate the title (which we moved) and the featured image.
February 24, 2021 at 7:41 pm #1671513George
It doesn’t work, the problem is in the
content-areaclass but I can’t see any CSS value that affects it. Very strange. I already have zeroed the margins for the featured image.I can live with that, though, it’s just very strange.
February 24, 2021 at 7:44 pm #1671519Leo
StaffCustomer SupportMy CSS should work – I’m not seeing it being added currently.
When I added it using the browser inspector tool, this is the result:
https://www.screencast.com/t/wm5iKQ7ZrDDFebruary 24, 2021 at 7:47 pm #1671522George
Ok, must be my browser.
Thanks, Leo, appreciate it!
February 24, 2021 at 7:49 pm #1671526Leo
StaffCustomer SupportNo problem 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.