Allow archive page title to be filtered

This commit is contained in:
Lee Willis 2012-10-16 21:30:50 +01:00
parent a66cff4119
commit 01a1a6b6a2
1 changed files with 6 additions and 5 deletions

View File

@ -26,19 +26,20 @@ get_header('shop'); ?>
<h1 class="page-title">
<?php if ( is_search() ) : ?>
<?php
printf( __( 'Search Results: &ldquo;%s&rdquo;', 'woocommerce' ), get_search_query() );
$page_title = sprintf( __( 'Search Results: &ldquo;%s&rdquo;', 'woocommerce' ), get_search_query() );
if ( get_query_var( 'paged' ) )
printf( __( '&nbsp;&ndash; Page %s', 'woocommerce' ), get_query_var( 'paged' ) );
$page_title .= sprintf( __( '&nbsp;&ndash; Page %s', 'woocommerce' ), get_query_var( 'paged' ) );
?>
<?php elseif ( is_tax() ) : ?>
<?php echo single_term_title( "", false ); ?>
<?php $page_title = 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, $shop_page->ID );
$page_title = apply_filters( 'the_title', ( $shop_page_title = get_option( 'woocommerce_shop_page_title' ) ) ? $shop_page_title : $shop_page->post_title, $shop_page->ID );
?>
<?php endif; ?>
<?php echo apply_filters ( 'woocommerce_archive_page_title', $page_title ); ?>
</h1>
<?php do_action( 'woocommerce_archive_description' ); ?>
@ -114,4 +115,4 @@ get_header('shop'); ?>
do_action('woocommerce_sidebar');
?>
<?php get_footer('shop'); ?>
<?php get_footer('shop'); ?>