Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How do I change the background color and take the header and menu out from woocoommerce's single product page? I tried custom css on specific post and tried to edit the page and it doesn't work at all. Thank you!

share|improve this question
add comment

1 Answer

If you need only hide header and menu by css your code should looks like this:

.single-product {
background: wheat;
}
.single-product #wrap_header, .single-product #main-menu { /* selector of your header and menu */
display:none;
}

And if you need rid of header and menu from source code then you need edit your header.php something like this:

function is_template($templateFile) {
global $template;

    if (  $template===WP_PLUGIN_DIR.'/woocommerce/templates/'.$templateFile ||
          $template===get_stylesheet_directory().'/'.$templateFile || 
          $template===get_stylesheet_directory().'/woocommerce/'.$templateFile ) 
    return true;
 else return false;
}

if ( !is_template('single-product.php')) {
    //show header and menu
}
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.