Hey @vytaulla51 – that does indeed sound like a little but of a tricky situation. It would help if you could explain a little more what the end result you’re hoping for is…
is the end goal to have a different background image for each page/post?
Hi:
No, the end goal is for the same background image to be on every page – and is behind the navigation too. See sample link.
Thanks!
Hey @vytaulla51 – thanks for clarifying. To do something like that what I’d recommend is that in your Page template(s) you have a group block outside the Header, content, and footer – and you can apply the background to the Group.
So you’d have something like:
– Group Block (with background)
– Header template part
– Content
– Footer template part
Could you try something like that to see how it goes?
Hi Jordesign!
Why didn’t I think of that??? I placed the cover block at the top of each template with the background image and put the header, content, footer template-parts inside it. That seemed to work!
Couple of questions:
1. Cover block doesn’t have a background-color setting — when styling themes via CSS I always had both a background-color in addition to a background-image in case the image didn’t load. Should I do that here? Do I need to place everything inside a group block just for the background-color?
2. You suggested using a group block which allows for background-color but not background-image. Was that because of question 1? Or is there some other reason?
3. The Group block has a sticky option – can that be used to create a sticky navigation?
Thanks, thanks, thanks!
Hey @vytaulla51
1. Cover block doesn’t have a background-color setting — when styling themes via CSS I always had both a background-color in addition to a background-image in case the image didn’t load. Should I do that here? Do I need to place everything inside a group block just for the background-color?
Good point – I’ve used the overlay color in that case (if I wanted a background color) but that wouldn’t work as a fallback. Another option would be to use
– Group (with background color)
– Cover (with background image).
2. You suggested using a group block which allows for background-color but not background-image. Was that because of question 1? Or is there some other reason?
Ah yes – as of the latest version of Gutenberg (16.7) background images are possible on Group blocks – so updating to that version may be the quickest option.
3. The Group block has a sticky option – can that be used to create a sticky navigation?
The answer to that is yes… but….
Sticky positioning currently works on top-level blocks (so they’re the very outer block in a template). So you could make a Group (which then contained a header) sticky and you’d get sticky navigation.
But in your case – because your outer-most block is the one containing everything – setting it to Sticky would make the whole site sticky…. which seems like it’s not something you’d really want 🙂
Hi:
Re: the sticky menu – no, I don’t want to have one on the sample site – I just wanted to confirm it’s possible for other sites if needed.
Thank you for your help!