How do I keep my header on the products page?

If you look at my site you will see the theme I created. It works fine when you go to store but when you click on the Products page you lose the header and sidebar. I have the mp_(pages) created and all request header and sidebar on them just as the page_php does. What might I be missing in this?

  • Mike
    • New Recruit

    Hi @jay_smull

    Thanks for the quick reply.

    This depends on the theme and you will have to change the location of the following to ensure that the sidebar and header are called in the right place.

    To include the header add this:
    <?php get_header(); ?>

    To add the sidebar:
    <?php get_sidebar(); ?>

    If you are struggling, please post the contents of the template file and I'll show you where it should go.

    I hope that helps!

    Cheers,
    Mike

  • jay_smull
    • WPMU DEV Initiate

    Mike,

    The php files I have do already have those tags in them. That is what makes no since to me.

    I am not well versed in php and css. I just know enough to make changes or copy and create. That is most of my problem I am sure.
    Okay, so tell me which page should be the actual template page? The page.php or one of the mp_(pages).php (i.e. mp_product.php)

    Sorry, this is a little beyond me but I am learning.

  • Mike
    • New Recruit

    Hi @jay_smull

    If you have mp_product.php then that will be used for the individual products, if it's not there, then the plugin will generate the page I believe.

    If you want me to have a quick look I'll see if I can spot the problem.

    To send the login details you can send them through our secure contact form
    1) In the subject field add "Attn: Mike"
    2) Include a link to this thread in the email
    3) Include Wordpress Super Admin/network access
    4) Include FTP & cPanel details
    5) Include any relevant URLS for your site
    6) Be sure to select "I have a different question"

    If you do the above it will come through and be assigned to me.

    If you are having problems with the contact form you can send them to contact(at)wpmudev.org please make sure the subject line is Attn: Mike and all details are included :slight_smile:

    Cheers,
    Mike

  • Mike
    • New Recruit

    Hi @jay_smull

    Thanks for sending your details in.

    I had a look at your site, and would never have got this from talking to you so thanks for sending the details as it saved a lot of time!

    In header.php and sidebar.php you had a couple if if statements. I guess there are some theme settings that determine whether to show the sidebar/header I commented those out so it shows them regardless and it's now working.

    Have a quick look and let me know what you think.

    Cheers,
    Mike

  • jay_smull
    • WPMU DEV Initiate

    Mike,

    Thank you soooo much for your help! Is there any way to let me know what files you had to change so that I can copy them to the domain that I am creating this look for? We are making this for a client and then having to recreate it onto their domain.

    Thanks a billion again!
    Jay and Angela Smull

  • Mike
    • New Recruit

    Hi @jay_smull

    Thanks for the quick reply!

    It was the following in your theme folder:
    header.php
    sidebar.php

    There are If statements on each wrapped around the sidebar, and they look something like this:
    <?php if...

    You'll notice that I have commended them out so they look like this:
    <!-- ?php if [..] -->

    And lower down you will see a:
    `<!-- ?php endif ? -->'

    What this is basically doing is stopping it being conditional and forcing it to always display the contents(sidebar and header)

    I hope that makes sense and I'm glad I could be helpful!

    I'm marking this as resolved.

    Cheers,
    Mike

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.