Archived topic
Different banner for inside pages
25 replies · Started by Kris on January 4, 2023
Hi guys,
Is there a way to have a totally different top banner for all other pages than the home page?
I'm after a lot more narrow banner in order to present more text content above the fold.
Thank you for your support!
Cheers,
Kris
Hi Kris,
What sort of banner are you referring to?
Can you provide a site that has a banner similar to what you're going for?
You may use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
The homepage banner is OK, but all other pages would benefit from a very narrow banner strip. I read that this is an important issue in Search Console, as it will then show a lot more text content above the fold for our articles.
I see.
Are you planning to use a different image as well for other pages?
If so, try adding this through Appearance > Customize > Additional CSS:
body:not(.home) header .inside-header{
padding-top: 30px;
}
body:not(.home) header.site-header {
background-image: url(https://images.unsplash.com/photo-1434725039720-aaad6dd32dfe?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1942&q=80)
}
Replace the image URL with your preferred Image URL.
Replace the 30px padding value with your preferred banner height as well.
OK, thanks for the code.
Actually, I made the banner 50pix smaller.
Also, I noticed that I have not ticked "Display featured images" on blog posts.
So, instead I have been manually adding the main images there.
Would you recommend ticking it?
Also, is there a way to move the secondary menu (the black bar at the top) to the bottom of the page?
This would give me a bit more space again above the fold.
I see.
To clarify, do you want the banner for Single Posts to be the Featured image?
Also, to clarify, do you want to move the Secondary nav after the content or after the footer?
Sorry, lets try that again :)
1. I am wondering if I should use “Display featured images” on blog posts instead of adding the main image manually.
2. I'd like to move the secondary menu (the black bar at the top) to the bottom of the page just above the blue Footer where it reads "Copyright © 2008 - 2023. All Rights Reserved"
3. ...and it seems that my widescreen featured images are being squeezed into a square in a mobile view. Can we fix this as well? https://i.postimg.cc/0yzjNgpm/mobileview.jpg
1. You don't have to add it manually. It can be added dynamically on Page Heroes or anywhere.
See this for instance: https://www.youtube.com/watch?v=yq6VcgU3Ufg
So, it would be preferential. You can use the default Featured Image, or set it up like what was done in the video above.
2. Can you try adding this PHP snippet?:
add_action('after_setup_theme','cu_move_sec_navigation');
function cu_move_sec_navigation() {
remove_action('generate_after_header', 'generate_add_secondary_navigation_before_header', 7 );
add_action('generate_before_footer', 'generate_add_secondary_navigation_before_header', 15 );
}
Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
3. Let's address this after we address #1.
1. OK, I will rather tick the “Display featured images” on posts.
2. Added the snippet. It created the secondary at the bottom OK, but it is still also at the top.
Hi there,
For #2 try this PHP snippet instead:
add_action('wp','cu_move_sec_navigation');
function cu_move_sec_navigation() {
remove_action('generate_after_header', 'generate_add_secondary_navigation_before_header', 7 );
add_action('generate_before_footer', 'generate_add_secondary_navigation_before_header', 15 );
}
Nope. Top nav. still there, mate.
I see. Can you try this instead?:
add_action('after_setup_theme','cu_move_sec_navigation');
function cu_move_sec_navigation() {
remove_action('generate_before_header', 'generate_add_secondary_navigation_before_header', 7 );
add_action('generate_before_footer', 'generate_add_secondary_navigation_before_header', 15 );
}
Yes! That did it! Thanks, Fernando.
How can I now add a link to the top banner to point to the homepage?
Also can we get back to 3:
It seems that my widescreen featured images are being squeezed into a square in a mobile view. Can we fix this so that they would retain the image proportions? https://i.postimg.cc/0yzjNgpm/mobileview.jpg
1. What kind of link do you want? Do you want the whole banner as a link?
Or, do you want to add a logo or text that points to the homepage?
3. Can you provide the link where we can observe the image with the issue in your screenshot?
As we removed the top nav (which had a link to our homepage) I would like to link the entire Social Media Revolver banner graphic to our homepage: https://socialmediarevolver.com This is the Header background image, and there is no option for a link in the settings.