- This topic has 13 replies, 4 voices, and was last updated 2 years, 7 months ago by Elvin.
-
AuthorPosts
-
July 31, 2021 at 10:20 pm #1878967Amit
Hi,
I want to create Header that looks similar to my other Post Headers. But, the fields were not working like description and author Title. So, I checked the old thread where Header was disabled and there was custom css for the same..
Still, this doesn’t go full width like my other pages. I need something similar to my Posts Header. with Author Description below the Author Image and Name.August 1, 2021 at 8:11 am #1879507DavidStaffCustomer SupportHi there,
can you share a post where i can see the Element displaying the Author Description ?
August 1, 2021 at 8:22 am #1879517AmitHere is the post –
August 1, 2021 at 9:39 am #1879596LeoStaffCustomer SupportThere isn’t an element displaying on the page you’ve linked currently.
This usually means the display rule you’ve set is incorrect.
What display rules are you using?
Let me know π
August 1, 2021 at 10:39 am #1879652AmitSee now… Activated the author element.
August 1, 2021 at 7:39 pm #1879901ElvinStaffCustomer SupportHi Amit,
I believe you can use the same header element you’ve used on the
/nespresso/best/
on your author archive page.On the same Header Element, add a display rule location for “Author Archives” so it’s also used on author archive pages.
August 1, 2021 at 9:20 pm #1879965AmitElvin,
The author element is activated and it is set for ‘Author Archives’. The problem is not the display rule, but the fields. The fields are not converting to what they are meant for – {{custom_field.description}}August 1, 2021 at 9:33 pm #1879973ElvinStaffCustomer SupportAh, in that case, consider this:
Create a new header element with similar styling but set the display rule for Author Archives.
And then add this PHP snippet.
add_shortcode('show_author_desc',function(){ if ( get_the_author_meta( 'description' ) && is_author() ) { echo '<div class="author-info">' . get_the_author_meta( 'description' ) . '</div>'; } });
This allows you to use the shortcode
[show_author_desc]
.On the newly created Header element, instead of using
{{custom_field.description}}
, use[show_author_desc]
instead. πAugust 1, 2021 at 10:42 pm #1880016AmitThat worked!
Now the image that is showing on that page is square and the Author name is just stocked to it.
I need the author image to be a little small, round shaped with border around and some space within the author name and image.August 1, 2021 at 10:48 pm #1880021ElvinStaffCustomer SupportYou can wrap the image on that Header element with
<div class="page-hero-gravatar">
the same way you did for the other Header element so they share the same styling. πOr just add this CSS for a quick and easy fix:
body.archive.author .page-hero img.avatar { width: 40px; height: 40px; border-radius: 50%; position: relative; margin: 0 10px 0 0; }
August 2, 2021 at 12:36 am #1880116AmitWorked! A little tweak was required as the image was a little below the level of author’s name. I added a margin of 15px at the bottom.
Please dual check from your side!August 2, 2021 at 2:07 am #1880231ElvinStaffCustomer SupportIt looks fine on my end – https://share.getcloudapp.com/geuAx851
Do you need anything else? I believe this is sorted?
Let us know if you need further help with this. π
August 2, 2021 at 8:49 pm #1881469AmitSorted!
August 2, 2021 at 10:24 pm #1881532ElvinStaffCustomer SupportNice one. Thanks for letting us know. Glad you got it sorted. π
-
AuthorPosts
- You must be logged in to reply to this topic.