Site logo

Archived topic

2 issues: Overlay Header + Top Bar / Content Template not showing in editor

6 replies · Started by Martin on February 28, 2023

Viewing posts 1–7 of 7

I have 2 problems that I have been trying to solve for hours, so I finally decided to ask for help :)

#1 Overlay Header + Top Bar

I created an Overlay Header using CSS that I found here on the forum. It works great, but the moment I try to place a top bar over the header this happens:

https://imgur.com/iAdFdBM


I understand it's because of - "Position: absolute, top: 0px"
and when I adjust it to e.g. top: 2em = header moves slightly down, problem "solved". But I would need the value Top: 0px/2em, to change depending on whether the top bar is displayed on the page or not. I simply don't want to manually adjust these values every time I decide to show or hide the top bar. For example via metabox custom field or ACF.

What I would like to see:
https://imgur.com/KQ6m5Xr

Is there a way to solve this?

#2 Design Content Template is not displaying

I created a content template for a custom post type, when I open the corresponding post as a visitor I see the applied design, but when I open the same post in the editor I only see a blank page. I expected to see the applied template design directly in the editor of each individual post it is assigned to, and then just edit the content of that post. Or is it different?

I wish to see it in the editor - and have option to edit it directly:
https://imgur.com/BbSMm5h

What I actually see:
https://imgur.com/f3iovlG

Thank you for any help.

and this is the CSS code used for Overlay Header:

body:is(.home) .site-header {
background: rgba(17,36,55,0.0);
position: absolute;
top: 0px;
left: 0;
z-index: 10000;
width: 100%;
}

Hi Martin,

Can you link us to your site?

For issue 1, instead of using that CSS, go to appearance > elements, create a header element, and activate the merge function for the front page.

Here's a video for your reference: https://youtube.com/watch?v=TP8mgBQTgGg&si=EnSIkaIECMiOmarE

It should set the topbar and site header both to position: absolute;

when I open the corresponding post as a visitor I see the applied design, but when I open the same post in the editor I only see a blank page

This is normal behaviour, the content template will only affect the front end.

Thank you for your help :)

You are welcome   :)

This archived topic is closed to new replies.