Skip to content

Commit

Permalink
Merge pull request #331 from pauloiankoski/patch-5
Browse files Browse the repository at this point in the history
Check if WC is activated
  • Loading branch information
adammacias committed Aug 13, 2015
2 parents caa4d8e + b8e1300 commit 1b5307e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,12 @@ function odin_breadcrumbs( $homepage = '' ) {
if ( 'post' != $post->post_type ) {
// But if Woocommerce
if ( 'product' === $post->post_type ) {
$shop_page = get_post( wc_get_page_id( 'shop' ) );
echo '<li><a href="' . get_permalink( $shop_page ) . '">' . get_the_title( $shop_page ) . '</a></li>';

// Gets Woocommerce post type taxonomies.
if ( is_woocommerce_activated() ) {
$shop_page = get_post( wc_get_page_id( 'shop' ) );
echo '<li><a href="' . get_permalink( $shop_page ) . '">' . get_the_title( $shop_page ) . '</a></li>';
}

// Gets post type taxonomies.
$taxonomy = get_object_taxonomies( 'product' );
$taxy = 'product_cat';

Expand Down Expand Up @@ -351,7 +353,7 @@ function odin_breadcrumbs( $homepage = '' ) {
// Custom post type archive.
} elseif ( is_post_type_archive() ) {
// Check if Woocommerce Shop
if ( is_shop() ) {
if ( is_woocommerce_activated() && is_shop() ) {
$shop_page_id = wc_get_page_id( 'shop' );
echo $current_before . get_the_title( $shop_page_id ) . $current_after;

Expand Down

0 comments on commit 1b5307e

Please sign in to comment.