6

I need to modify the get_header('shop') file in Woocommerce but don't know where it's located, if someone knows please help me out - thanks!

11

get_header( $name ) is a Wordpress function, that will try to load the file header-{$name}.php from your theme's root folder. If this file doesn't exist, Wordpress will load the default header.php file.

| improve this answer | |
  • 1
    Thanks for the answer. So I'll try to upload my own version of header-shop.php and see if that solves it. Thanks. – Joe R. Sep 6 '13 at 0:53
  • What is exactly your problem? – cybmeta Sep 6 '13 at 1:00
  • My problem is that on the regular pages of my theme, it displays an H1 header from the page title, but on the Product Pages it seems to be pulling from the same header.php and not header-shop.php (because that doesn't exist) but when I look in the header.php there is no reference to the single-product header tag that should logically make it act differently – Joe R. Sep 6 '13 at 1:10
  • I think you are looking in the wrong file; I suspect that you should look into the single product template and not in any header template. – cybmeta Sep 6 '13 at 1:19
  • if((is_tax() && taxonomy_exists('product_cat') && $current_tax == "product_cat") || is_singular('product')) { echo ''; } elseif (((is_home()|| is_page() || is_single()) && intval(get_post_meta($post_id , 'title-show', true)) == 0) && !is_front_page()) { ?> <div id="page-header" class="container"> <div class="page-header-content row-fluid"> <div class="title span12"> <?php $title = get_post_meta($post_id, 'title-content', true); if($title == '') $title = '<h1>'.get_the_title($post_id).'</h1>'; – Joe R. Sep 6 '13 at 1:21
1

get_header() is a WordPress function (not a WooCommerce specific one) and if passed a parameter should load a file named header-<parameter>.php from the theme root (or parent theme root). So there should be a file named header-shop.php in the same directory as header.php or footer.php.

| improve this answer | |
  • Ok thanks for the information - I've looked everywhere for that info in the theme files but it seems to be missing. If that file doesn't exist can I create it myself and will it pull from the one I create? – Joe R. Sep 6 '13 at 0:28
  • No I'm just using the standard 'Alterna' theme from Themeforest, no child theme of it – Joe R. Sep 6 '13 at 1:08
  • Ummm... you are concerned about "Woocommerce templates" and are using a theme from ThemeForest so... what is the connection? – s_ha_dum Sep 6 '13 at 1:14
  • Ohh...the theme I'm using has some modified woocommerce files that overrides the standard woocommerce files - does that make sense? I'm dealing with those custom woocommerce files from the theme – Joe R. Sep 6 '13 at 1:27
  • So your theme is a child? – s_ha_dum Sep 6 '13 at 1:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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