Archived topic
default blog image size not set to cover
9 replies · Started by sdanbu on May 17, 2017
I'm trying to change the size of the header image in the default blog page.
I would like it to cover full container and be transparent behind the menu.
Is there a way to set it to be (the way header-content in static pages can be set up)?
I looked at tutorials and I went to customizer > blog> page header but the settings aren't there or maybe I missed something.
https://docs.generatepress.com/article/blog-page-header/
Thank you
The settings should be there as long as the Page Header add-on is activated.
I can't find the settings. I went to customizer > blog > page header >
the settings say resize image but not transparent behind header etc.
You have to add content into the content area for those additional settings to show up. It's the exact same as this article, just in the Customizer instead of the meta box: https://docs.generatepress.com/article/merging-header-navigation-content/
This works for page header in static pages but not in the default blog page ...or at least I don't know how to access the setting in the blog page
Can you show a screenshot of Customizer > Blog > Page Header Content with some content added into the content area?
OK that helped me find the spot where I had to enter the content. Thanks
Now I did that but I my blog posts don't change.
It worked for default blog page but how do I make the background in the posts change? Do I have to change the header background for every post? Or is there some way to use hooks?
I clicked Enable under customizer > blog > page header content "Image Background Use the image uploaded above as a background image for your content. (requires image uploaded above)" but it didn't change the header for posts
This should help: https://docs.generatepress.com/article/blog-page-header/#displaying-the-blog-page-header-elsewhere
and this should be the conditional tag you would need: https://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page
Thanks for your help
In link one it says that I can have the blog header on other pages using this:
add_filter( 'generate_get_blog_page_header','__return_true' );
is this CSS or a PHP snippet?
Also, do you know if this applies only to blog posts or also to static pages?
In link 2, it says "You can only use conditional query tags after the posts_selection action hook in WordPress (the wp action hook is the first one through which you can use these conditionals). For themes, this means the conditional tag will never work properly if you are using it in the body of functions.php, i.e. outside of a function."
am I supposed to use a certain conditional tag in a hook?
Filters are PHP snippet.
If you want to apply to all single posts, this should be it:
add_filter( 'generate_get_blog_page_header','tu_category_blog_page_header' );
function tu_category_blog_page_header() {
if ( is_single() ) {
return true;
}
return false;
}