Skip to content

Instantly share code, notes, and snippets.

@johnmccole
Last active January 4, 2018 09:13
Show Gist options
  • Save johnmccole/e3ed7a27242f5627f263b99fcc96f856 to your computer and use it in GitHub Desktop.
Save johnmccole/e3ed7a27242f5627f263b99fcc96f856 to your computer and use it in GitHub Desktop.
Installing WooCommere to a site using the Sage theme causes shop pages to have duplicate content. To resolve this, create several new files, header-shop.php, footer-shop.php and sidebar-shop.php. This will remove both instances of the element. You can then edit files with custom content to add required elements (e.g titles, breadcrumbs). Example…
<?php // this file is to stop duplicate headers - DO NOT EDIT ?>
<?php
if ( function_exists('yoast_breadcrumb') ) {
yoast_breadcrumb('
<p id="breadcrumbs">','</p>'
);
}
?>
<?php if ( is_product() ):
echo '<aside>';
dynamic_sidebar( 'sidebar-shop-product' );
echo '</aside>';
endif; ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment