Skip to content

Commit

Permalink
Double shop page in breadcrumb and white space issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikejolley committed Feb 16, 2015
1 parent 600b561 commit bd11f51
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
1 change: 0 additions & 1 deletion includes/class-wc-breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ private function add_crumbs_shop() {
$_name = $product_post_type->labels->singular_name;
}

$this->prepend_shop_page();
$this->add_crumb( $_name, get_post_type_archive_link( 'product' ) );
}

Expand Down
2 changes: 1 addition & 1 deletion includes/wc-template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,7 @@ function woocommerce_checkout_login_form() {
*/
function woocommerce_breadcrumb( $args = array() ) {
$args = wp_parse_args( $args, apply_filters( 'woocommerce_breadcrumb_defaults', array(
'delimiter' => ' / ',
'delimiter' => ' / ',
'wrap_before' => '<nav class="woocommerce-breadcrumb" ' . ( is_single() ? 'itemprop="breadcrumb"' : '' ) . '>',
'wrap_after' => '</nav>',
'before' => '',
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
* Fix - Stock status when updating out of stock product.
* Fix - Fix place order button text on init.
* Fix - When duplicating products, handle entities.
* Fix - Double shop page in breadcrumb and white space issues.
* Tweak - Added DOMDocument item in the System Status as a requirement.
* Tweak - Simplify default mode should be 'standard'.
* Tweak - Set attribte 'query_var' true when public.
Expand Down
33 changes: 16 additions & 17 deletions templates/global/breadcrumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,29 @@
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
?>

<?php if ( $breadcrumb ) : ?>
if ( $breadcrumb ) {

<?php echo $wrap_before; ?>
echo $wrap_before;

<?php foreach ( $breadcrumb as $key => $crumb ) : ?>
foreach ( $breadcrumb as $key => $crumb ) {

<?php echo $before; ?>
echo $before;

<?php if ( ! empty( $crumb[1] ) && sizeof( $breadcrumb ) !== $key + 1 ) : ?>
<?php echo '<a href="' . esc_url( $crumb[1] ) . '">' . esc_html( $crumb[0] ) . '</a>'; ?>
<?php else : ?>
<?php echo esc_html( $crumb[0] ); ?>
<?php endif; ?>
if ( ! empty( $crumb[1] ) && sizeof( $breadcrumb ) !== $key + 1 ) {
echo '<a href="' . esc_url( $crumb[1] ) . '">' . esc_html( $crumb[0] ) . '</a>';
} else {
echo esc_html( $crumb[0] );
}

<?php echo $after; ?>
echo $after;

<?php if ( sizeof( $breadcrumb ) !== $key + 1 ) : ?>
<?php echo $delimiter; ?>
<?php endif; ?>
if ( sizeof( $breadcrumb ) !== $key + 1 ) {
echo $delimiter;
}

<?php endforeach; ?>
}

<?php echo $wrap_after; ?>
echo $wrap_after;

<?php endif; ?>
}

0 comments on commit bd11f51

Please sign in to comment.