- This topic has 42 replies, 4 voices, and was last updated 4 years, 1 month ago by Tom.
-
AuthorPosts
-
February 3, 2020 at 4:43 pm #1153474TomLead DeveloperLead Developer
Hi there,
1. So are you wanting the static featured image inside the content, and no background image in the Page Hero?
2. Try changing your content to this:
<h1> {{post_title}} </h1> <div class="hero-meta">{{post_author}} [avatar]</div>
Then try reducing your page hero padding.
3. For the link colors, are you sure the link color is set in your Page Hero settings?
February 4, 2020 at 11:22 am #1154512JacobHi Tom, thanks. Everything works pretty fine now. But I still did not manage to only get 1 imageinside the content. Even after changing the conten as you suggested.
Actually, I would not mind keeping the standard, defaul settings with H1 in the top (inside container) and then image with the Author image and author title covering the image. (Maybe with the “parallax” function).
Or I could have as before both header and author over the image but it would be nice with the image inside the content (and with only 1 image not 1 above and then 1 inside).
Thanks.
February 4, 2020 at 3:50 pm #1154711TomLead DeveloperLead DeveloperDo you have any examples of the layout/look you’re aiming for? It might help me understand a bit better.
Let me know 🙂
February 4, 2020 at 4:00 pm #1154719JacobHi Tom! How about this page: https://webshopsguiden.se/dropshipping/
But with a featured image with name of author in the left, lower corner (of the image)?Thanks
February 5, 2020 at 9:09 am #1155654TomLead DeveloperLead DeveloperAhh, so you want the page hero inside the content?
If so, try this:
add_filter( 'generate_page_hero_location', function() { return 'generate_before_content'; } );
February 5, 2020 at 4:21 pm #1156043JacobThanks Tom I was not sure if that code goes in the content area or in the CSS. But I assume it is a CSS code anyway, I tried both just to be sure and it does not work. Still have 2 images and the author + img stayes in the upper image.
Is there anyway I could you access to fix the problem?
February 6, 2020 at 2:45 am #1156336DavidStaffCustomer SupportHi there,
that code is PHP – this article explains how to add it to your site:
https://docs.generatepress.com/article/adding-php/
TLDR: If you don’t have a Child Theme – use the Code Snippets plugin to add the code.
February 6, 2020 at 8:26 am #1156811JacobHi thanks, sorry I’m a bit lost here.. So I am using GP Premium, I don’t know if that is a “Child theme”?
Thanks amd sorry:)
/Jacob
February 6, 2020 at 8:55 am #1156848JacobThanks, I installed the plugin and entered the code it worked! Cool!
1. So, what if I would like to keep the default header (above the feaured image). How could I disable the H1 from the page Header/Hero and only keep the deafault theme header? (If this is troublesom I can keep it the way it is now but would be an interesting option).
2. I see that the text starts very close to the image (unlike the default pages I have else where on the site) How could I create some space between the featured image and the the first paragraph? (So it looks as the pther pages without the page header)?
3. The [Avatar] comes with a link for the author name. Same it seems for your {{post_author}}. Can I enter some code to idsable that link and just present the name in plain text?Thanks very much for your support! Sorry about my rookie-questions:)
/Jacob
February 6, 2020 at 4:51 pm #1157203TomLead DeveloperLead Developer1. Not too sure what you mean here – if you want the H1 removed from the Header Element, you should just be able to remove it from the hero content.
2. Try this CSS:
.page-hero { margin-bottom: 40px; }
3. This depends on where [avatar] is coming from. As for {{post_author}}, try this PHP:
add_filter( 'generate_page_hero_post_author', function() { global $post; $author_id = $post->post_author; return sprintf( '<span class="author vcard" itemtype="http://schema.org/Person" itemscope="itemscope" itemprop="author"><span class="author-name" itemprop="name">%1$s</span></span>', esc_html( get_the_author_meta( 'display_name', $author_id ) ) ); } );
February 7, 2020 at 5:30 am #1157755JacobThanks Tom. Amazing!
1. When I remove the H1 from the content in the Element the H1 disappears= no Page title on the page at all. What I am asking is to keep the H1 as it is without any Header Element but to be able to add/keep the author image, name and parallax (covering the featured image). So the header is actually not in the Header element, but the other things are in the element.. But maybe this is done with just another page hero hook.. (?) (Not the “Header element”)
2. Great! Works! Thanks!
3. Great! Works! Thanks!Thanks for everything!
/Jacob
February 7, 2020 at 5:02 pm #1158413TomLead DeveloperLead DeveloperAre you disabling the content title another way? Maybe using Disable Elements?: https://docs.generatepress.com/article/disable-elements-overview/
February 9, 2020 at 6:55 am #1159676JacobHi Tom, thanks. No I am not disable the lements in any other way. (I doubble checked).
February 9, 2020 at 9:43 am #1159804TomLead DeveloperLead DeveloperCan you remove the title from the page hero so I can see?
If the title isn’t displaying it means:
a) The Disable Elements metabox has it disabled
b) You have a Layout Element applied which is disabling it
c) You have a custom function which is disabling itFebruary 9, 2020 at 2:18 pm #1159998JacobHi Tom! You are completely right. (You must have a lot of patience. Thanks). I am an idiot. Now when I take the h1 out the header appears as it should. Maybe I missed it since it appears under the image, instead of above (as the default theme).
1. If I want the header to appear above the image, how could I do that?
2. Another thing since I already have this topic open:
How could I place the name of the author below the author-image, instead of on the right hand side of the image?
I am using this content in the element:
[avatar]
{{post_author}}Thanks and sorry!
-
AuthorPosts
- You must be logged in to reply to this topic.