Site logo

Archived topic

Custom Category Page Shows Blank

9 replies · Started by Michelle on July 28, 2022

Viewing posts 1–10 of 10

My custom category page shows from the dashboard, but the front end is blank.

Hi Michelle,

What specific change in your site did you add before this issue occurred?

Can you try disabling the codes we’ve added recently one by one and check if the issue will be resolved? Let’s check if there may have been a syntax error or something else.

There was a syntax error I think. Where can I send a screenshot? Would it help?

I figured out what made my custom category page go blank. It was this CSS:

/*Hide hamburger menu on my custom page, my custom category archive*/
body.page-id-6619, .page-id-6707 .main-navigation .menu-bar-items .slideout-toggle,
body.page-id-6619, .page-id-6707 #mobile-header .menu-toggle {
    display: none;
}

I removed the CSS and the page came back. I still need the hamburger menu to be hidden or removed though.
:)

If you want to remove any toggles on page-id-6619 and page-id-6707 - then try changing your CSS to this:


/*Hide hamburger menu on my custom page, my custom category archive*/
body:where( .page-id-6619, .page-id-6707 ) .main-navigation .menu-bar-items .slideout-toggle,
body:where( .page-id-6619, .page-id-6707 ) #mobile-header .menu-toggle {
    display: none;
}

That worked. Thank you.

How do I also disable the hamburger menu on Single Post Pages from that specific category? (ID 6619)

One approach is to add the CSS through a Hook Element. Then set the display rule accordingly.

So just this:

<style>
.main-navigation .menu-bar-items .slideout-toggle, #mobile-header .menu-toggle {
    display: none;
}</style>

And the display location should be Post Category - choose the specific category.

Another approach, if you’r using a child theme, would be to create your own stylesheet and enqueue it only for the specific page.

An example would be something like the one shared here: https://wordpress.stackexchange.com/questions/249948/load-a-different-stylesheet-in-a-category-post#:~:text=You-,can%20do,-it%20like%2D

Hope this helps!

That more than helped. Good to know.

You’re welcome Michelle!

This archived topic is closed to new replies.