Created
December 19, 2012 07:03
-
-
Save kloon/4334989 to your computer and use it in GitHub Desktop.
WooCommerce remove Page from title of archive pages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function woocommerce_content() { | |
if ( is_singular( 'product' ) ) { | |
while ( have_posts() ) : the_post(); | |
woocommerce_get_template_part( 'content', 'single-product' ); | |
endwhile; | |
} else { | |
?><h1 class="page-title"> | |
<?php if ( is_search() ) : ?> | |
<?php printf( __( 'Search Results: “%s”', 'woocommerce' ), get_search_query() ); ?> | |
<?php elseif ( is_tax() ) : ?> | |
<?php echo single_term_title( "", false ); ?> | |
<?php else : ?> | |
<?php | |
$shop_page = get_post( woocommerce_get_page_id( 'shop' ) ); | |
echo apply_filters( 'the_title', ( $shop_page_title = get_option( 'woocommerce_shop_page_title' ) ) ? $shop_page_title : $shop_page->post_title ); | |
?> | |
<?php endif; ?> | |
</h1> | |
<?php do_action( 'woocommerce_archive_description' ); ?> | |
<?php if ( is_tax() ) : ?> | |
<?php do_action( 'woocommerce_taxonomy_archive_description' ); ?> | |
<?php elseif ( ! empty( $shop_page ) && is_object( $shop_page ) ) : ?> | |
<?php do_action( 'woocommerce_product_archive_description', $shop_page ); ?> | |
<?php endif; ?> | |
<?php if ( have_posts() ) : ?> | |
<?php do_action('woocommerce_before_shop_loop'); ?> | |
<ul class="products"> | |
<?php woocommerce_product_subcategories(); ?> | |
<?php while ( have_posts() ) : the_post(); ?> | |
<?php woocommerce_get_template_part( 'content', 'product' ); ?> | |
<?php endwhile; // end of the loop. ?> | |
</ul> | |
<?php do_action('woocommerce_after_shop_loop'); ?> | |
<?php else : ?> | |
<?php if ( ! woocommerce_product_subcategories( array( 'before' => '<ul class="products">', 'after' => '</ul>' ) ) ) : ?> | |
<p><?php _e( 'No products found which match your selection.', 'woocommerce' ); ?></p> | |
<?php endif; ?> | |
<?php endif; ?> | |
<div class="clear"></div> | |
<?php do_action( 'woocommerce_pagination' ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment