• Resolved ghsjoerdstra

    (@ghsjoerdstra)


    Hi, I have been working on my storefront child theme and I was wondering how I can change the header of the category page so it isn’t the same as the homepage. I am aware of get_header(); but have a hard time figuring out which get header I need to change to get the result I want.

    • This topic was modified 5 years, 11 months ago by ghsjoerdstra.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Hey @ghsjoerdstra

    If you want to apply the get_header() function only on a specific page, you can wrap it in a conditional that checks for the category ID. For example, to apply the function only on the page that shows the items in the category “Toys”, you can use:

    if(is_category( 'Toys' )) {
       [ your function and code goes here ]
    }

    If you want to change it on all category pages, as well as other archive pages, you might want to try this:

    if(is_archive()) {
       [ your function and code goes here ]
    }

    Otherwise, you may be able to use CSS code to replace the header image on category pages.

    Thread Starter ghsjoerdstra

    (@ghsjoerdstra)

    @senff Thank you a lot! Never realized this could be done with a conditional.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Different header for category page’ is closed to new replies.