WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[Plugin: WooCommerce] Editing Breadcrumbs for Single Product Pages (2 posts)

  1. matthewmsexton
    Member
    Posted 1 year ago #

    The breadcrumbs seem to operate differently between the general shop pages and the single product pages.

    I was able to locate the shop page "breadcrumb.php" but can't seem to find a similar PHP file for the single-product pages.

    Can anyone help me to resolve this? Much obliged.

    http://wordpress.org/extend/plugins/woocommerce/

  2. bheadrick
    Member
    Posted 1 year ago #

    same code is used for both.

    sincle-product.php shows

    /**
    		 * woocommerce_before_main_content hook
    		 *
    		 * @hooked woocommerce_output_content_wrapper - 10 (outputs opening divs for the content)
    		 * @hooked woocommerce_breadcrumb - 20
    		 */

    in woocommerce-hooks.php

    add_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 );

    in woocommerce-template.php

    function woocommerce_breadcrumb( $args = array() ) {
    
    		$defaults = array(
    			'delimiter'  => ' › ',
    			'wrap_before'  => '<div id="breadcrumb" itemprop="breadcrumb">',
    			'wrap_after' => '</div>',
    			'before'   => '',
    			'after'   => '',
    			'home'    => null
    		);
    
    		$args = wp_parse_args( $args, $defaults  );
    
    		woocommerce_get_template( 'shop/breadcrumb.php', $args );
    	}

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic