mirror of
https://github.com/woocommerce/storefront.git
synced 2025-08-21 04:11:59 +08:00
loop template
This commit is contained in:
parent
bd5fbff3f9
commit
468136e0b1
5 changed files with 43 additions and 49 deletions
15
archive.php
15
archive.php
|
@ -77,20 +77,7 @@ get_header(); ?>
|
|||
?>
|
||||
</header><!-- .page-header -->
|
||||
|
||||
<?php /* Start the Loop */ ?>
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php
|
||||
/* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'content', get_post_format() );
|
||||
?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php storefront_paging_nav(); ?>
|
||||
<?php get_template_part( 'loop' ); ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
* @see storefront_scripts()
|
||||
* @see storefront_header_widget_region()
|
||||
*/
|
||||
add_action( 'after_setup_theme', 'storefront_setup' );
|
||||
add_action( 'widgets_init', 'storefront_widgets_init' );
|
||||
add_action( 'wp_enqueue_scripts', 'storefront_scripts' );
|
||||
add_action( 'after_setup_theme', 'storefront_setup' );
|
||||
add_action( 'widgets_init', 'storefront_widgets_init' );
|
||||
add_action( 'wp_enqueue_scripts', 'storefront_scripts' );
|
||||
add_action( 'storefront_before_content', 'storefront_header_widget_region', 10 );
|
||||
|
||||
/**
|
||||
|
@ -45,12 +45,18 @@ add_action( 'storefront_footer', 'storefront_credit', 20 );
|
|||
* @see storefront_popular_products()
|
||||
* @see storefront_on_sale_products()
|
||||
*/
|
||||
add_action( 'homepage', 'storefront_page_content', 10 );
|
||||
add_action( 'homepage', 'storefront_page_content', 10 );
|
||||
add_action( 'homepage', 'storefront_product_categories', 20 );
|
||||
add_action( 'homepage', 'storefront_recent_products', 30 );
|
||||
add_action( 'homepage', 'storefront_featured_products', 40 );
|
||||
add_action( 'homepage', 'storefront_popular_products', 50 );
|
||||
add_action( 'homepage', 'storefront_on_sale_products', 60 );
|
||||
add_action( 'homepage', 'storefront_popular_products', 50 );
|
||||
add_action( 'homepage', 'storefront_on_sale_products', 60 );
|
||||
|
||||
/**
|
||||
* Loop
|
||||
* @see storefront_paging_nav()
|
||||
*/
|
||||
add_action( 'storefront_loop_after', 'storefront_paging_nav', 10 );
|
||||
|
||||
/**
|
||||
* Extras
|
||||
|
|
15
index.php
15
index.php
|
@ -18,20 +18,7 @@ get_header(); ?>
|
|||
|
||||
<?php if ( have_posts() ) : ?>
|
||||
|
||||
<?php /* Start the Loop */ ?>
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php
|
||||
/* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'content', get_post_format() );
|
||||
?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php storefront_paging_nav(); ?>
|
||||
<?php get_template_part( 'loop' ); ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
|
|
28
loop.php
Normal file
28
loop.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
/**
|
||||
* The loop template file.
|
||||
*
|
||||
* Included on pages like index.php, archive.php and search.php to display a loop of posts
|
||||
* Learn more: http://codex.wordpress.org/The_Loop
|
||||
*
|
||||
* @package storefront
|
||||
*/
|
||||
|
||||
do_action( 'storefront_loop_before' );
|
||||
|
||||
while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php
|
||||
/* Include the Post-Format-specific template for the content.
|
||||
* If you want to override this in a child theme, then include a file
|
||||
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'content', get_post_format() );
|
||||
?>
|
||||
|
||||
<?php endwhile;
|
||||
|
||||
/**
|
||||
* @hooked storefront_paging_nav - 10
|
||||
*/
|
||||
do_action( 'storefront_loop_after' );
|
16
search.php
16
search.php
|
@ -16,21 +16,7 @@ get_header(); ?>
|
|||
<h1 class="page-title"><?php printf( __( 'Search Results for: %s', 'storefront' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
|
||||
</header><!-- .page-header -->
|
||||
|
||||
<?php /* Start the Loop */ ?>
|
||||
<?php while ( have_posts() ) : the_post(); ?>
|
||||
|
||||
<?php
|
||||
/**
|
||||
* Run the loop for the search to output the results.
|
||||
* If you want to overload this in a child theme then include a file
|
||||
* called content-search.php and that will be used instead.
|
||||
*/
|
||||
get_template_part( 'content', 'search' );
|
||||
?>
|
||||
|
||||
<?php endwhile; ?>
|
||||
|
||||
<?php storefront_paging_nav(); ?>
|
||||
<?php get_template_part( 'loop' ); ?>
|
||||
|
||||
<?php else : ?>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue