Archived topic
Hero Section - Premium 1.7rc2
13 replies · Started by Tim on August 1, 2018
I'm probably missing something, or misconfiguring something but my goal is to create a "hero section" only for the main page using he new Elements of GP Premium 1.7.
I prefer my navigation and site to be simple so I have it setup so that the homepage uses "latest posts". This way my main url is mydomain.com, and shows X number of lasts posts with pagination at the bottom and clicking on page 2 changes the URL to mydomain.com/page/2, etc. Simple and Clean.
I've then created an Element called Home, added some content in the PageHero section and set the display rules / Location to Front Page. But, this does not show up anywhere. If I change it to "Entire Site" it does show, but now it's on all other pages. Not what I want.
What am I missing? Thanks :)
Hi there,
The Front Page is for a Static Home Page. Use the Blog instead.
David, thanks for the response.
That is what I figured but using blog, the hero content is showing on page/2, page/3, etc. I just want it on the home page.
odd then select Page and choose only that page.
Can't select a page because there are no pages. This is using the default page. If I create a page for just the home page it means no blog posts on the home page without using another plug-in. Not what I want.
It would seem to me that there should be a way to display the hero content or any content, or hook for that matter only on the home page of the blog and to ignore page/2, page/3, etc.
Sorry - try the Posts Archive..... having a blond moment
Yeah, not working.
Again, Homepage Settings / Your homepage displays - set to: "Your latest posts".
Home page mydomain.com shows 4 posts and then a 1,2 Next ->
Clicking on "Next" or "2" brings me to mydomain.com/page/2
Would like the hero content on mydomain.com but not mydomain.com/page/x or mydomain.com/pagename or mydomain.com/postname.
Can you provide a link to the Site? You can edit your original topic and add it to the Site URL for privacy
I've added the site domain.
Thanks....
Hi there,
Try this function:
add_filter( 'generate_header_element_display', function( $display ) {
if ( is_paged() ) {
$display = false;
}
return $display;
} );
Let me know :)
Hi Tom,
So I am using the snippets plug-in. I added a new snippet and added your function. The hero section is now gone except for the home page. Yay!
You rock as usual :)
Do you suggest using snippets plug-in or do you prefer another method?
One last thing, with the new Elements feature, are there plans to have it work as reusable content that can appear as a widget by chance? This way we can place content in our side bar or inline in a post and then update it everywhere all at once.
I know there are plug-ins for this too but it seems Elements would work nicely for this ?
Code Snippets is a great plugin. If you already have a child theme, then the functions.php file of the child theme is better.
Some Element types might be turned into shortcodes. Although I don't think the Header type ever will.
I try to avoid child themes so I'l stick with Code Snippets.
Elements has so much potential. This way we can avoid page builders except for really complex stuff. Being able to bring up a list of elements in the word press editor and inserting them into the post or page would be super cool. :)
Anyway, just my .02. Thanks again for the excellent support.
I agree - lots more to come from Elements :)
Thank you!