Looking for a conditional tag to use for the Products, Shopping Cart, and Checkout pages

I’ve been using conditional tags to designate different headers (including my page navigation bar) on different pages of my wordpress site using my theme’s styling options. Since I installed Marketpress, I’ve been trying to get my logo header to appear on the Products, Shopping Cart, and Checkout pages. I tried using (is_shop_page), but that didn’t work and when I began messing around with the Plugin’s .php I “broke” it and had to reinstall. Thought I should ask for help this time around. Here is what I’ve been using to determine which pages get what header. I need to insert the tag for those pages into the second part (I want those pages to {echo ‘%bar2 %logo %pages %bar2’ ; }:

<?php if ( is_home() || (is_page(‘Blog’:wink: || is_page(‘The Trip’:wink: || is_page(‘Snapshots’:wink: || in_category(‘Sustainable Living’:wink: || in_category(‘Art’:wink: || in_category(‘Living on a Sailboat’:wink: || in_category(‘Travel’:wink: ) ) {echo ‘%bar2 %image %pages %bar2’ ; } if ( is_page(‘Lookbook’:wink: || is_page(‘Art’:wink: || is_page(‘About’:wink: || is_page(‘Shop’:wink: || is_tax(‘product_category’:wink: || is_singular(‘product’:wink:) {echo ‘%bar2 %logo %pages %bar2’ ; } ?>

Do I need to create a taxonomy for these pages to group them together of is there something else I can insert here that will work?

Here is my website’s shop: http://www.forestandfin.com/shop. You can see the header on the Shop page, but when you go to the products page (link in the drop menu), the header isn’t there. I’m no expert in web design, but hopefully you get the gist of what I’m trying to do.

Thanks for your help!

  • DavidM
    • DEV MAN’s Mascot

    Hi forestandfin and welcome to WPMU DEV!

    I’m not sure there’s a conditional tag to check for MarketPress virtual pages actually, but I’ll run that by the developers to be sure.

    The way you’d normally customize MarketPress pages would be through the use of templates as mentioned in the following file in the MarketPress folder:


    And with that, to customize the single product listings, you could easily copy your theme’s single.php and rename it mp_product.php, then customize the header in that file as you like, for example.

    And you could do similar for the cart and checkout pages with the mp_cart.php, copying perhaps your single.php again.

    How would that work for you?



  • forestandfin
    • New Recruit

    Hi Aaron,

    I’m a little confused. What do you mean by “copy the checks in the load store templates function”? my web-design knowledge is limited…. :slight_smile: I tried inserting is_shop_page() in the conditional phrase above, but it doesn’t work, so I am obviously missing something.


  • Aaron
    • CTO

    is_shop_page() is what you want, the problem is in your if logic above. With all those ORs in there one of them is resulting to true before it even gets to checking is_shop_page().

    If you want us to debug the logic please paste it with proper code tags surrounding.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.