• Resolved nootkan

    (@nootkan)


    Hi I have woocommerce installed on the twenty-seventeen theme with no issues noticed as of yet. However, I am also using the Unique Headers plugin which works fine with everything else except for woocommerce generated pages.

    I searched the plugin authors forum and found this reply which suggests asking you for help which I am doing.

    Please read the thread for a better understanding of what the plugin author needs to make this work with woocommerce generated pages.

    Header Woocommerce

    Thanks for your support.

    • This topic was modified 7 years ago by nootkan.
    • This topic was modified 7 years ago by nootkan.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    What Ryan said is correct, the automatically generated pages like “shop” and “product categories” are not typical WP pages, so your custom header setting isn’t being read.

    You would instead need to check if the current page is the shop page for example using conditionals like is_shop(), then using the wc_get_page_id( 'shop' ) function you can find the actual “page” that you’ve setup for the shop. And lastly, you can use this ID you’ve just found to substitute out the header.

    I’m afraid we can’t really help with customizations like this though. Might need to hire a developer:

    https://jobs.wordpress.net/
    https://codeable.io/
    https://woocommerce.com/experts/?project-scope%5B0%5D=1819

    Ryan Hellyer

    (@ryanhellyer)

    I’m also available for hire too.

    Caleb, do you know why WooCommerce behaves like this? I remember being very surprised when I saw this, and didn’t understand why it didn’t just hook into a regular page and add to the_content().

    My gut says this is some oddball legacy code left behind due to an earlier developer not understanding how WordPress templates work, but perhaps there’s some reason for it that I haven’t thought of yet.

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    So, it actually does do some fancy injecting now in WC 3.3+ if the theme doesn’t declare WC support specifically: https://woocommerce.wordpress.com/2017/12/09/wc-3-3-will-look-great-on-all-the-themes/

    If the theme does declare WC support (or a default WP theme), then a page like “Shop” is taken over. The reasoning, afaik, is pretty much just that WP didn’t and doesn’t have a great way to manage post type archives. So we have a shop page that allows for content editing, but then have to inject that into the actual archive template. The alternative is not using an actual archive, but shortcodes instead to list out a posts (products) loops.

    You’ll find this is the same behavior as the “posts page” in WP core. This page is manually set as the posts page in settings (same as shop page), and is then overridden as an archive page rather than an actual page. You just don’t notice this case as much, because themes all adjust for the posts page.

    Thread Starter nootkan

    (@nootkan)

    Thanks for your replies. I have woocommerce 3.3.3 with twenty-seventeen theme and the custom header plugin works with every page but the shop and product pages.

    I had to use css to hide the header image on those pages but for some reason css won’t change the header image.

    I have also tried using conditionals like your suggestion above but no luck. I have hired someone but they are having a tough time also.

    Oh well what can you do.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Getting Woocommerce Created Pages To Work With Different Headers’ is closed to new replies.