-
-
Save jamiemitchell/5667146 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<?php | |
/** | |
* Customize Product Category Query | |
* @link http://www.billerickson.net/customize-the-wordpress-query/ | |
*/ | |
function be_product_category_query( $query ) { | |
if( $query->is_main_query() && !is_admin() && $query->is_tax( 'product-category' ) ) { | |
$query->set( 'orderby', 'title' ); | |
$query->set( 'order', 'ASC' ); | |
$query->set( 'posts_per_page', '-1' ); | |
} | |
} | |
add_action( 'pre_get_posts', 'be_product_category_query' ); |
This file contains hidden or 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
<?php | |
remove_action ('genesis_loop', 'genesis_do_loop'); | |
add_action( 'genesis_loop', 'jm_custom_do_loop' ); | |
function jm_custom_do_loop() { | |
if( have_posts() ): | |
echo '<ul>'; | |
while ( have_posts() ) : $loop->the_post(); | |
echo '<li><a href="' . get_permalink() . '">' . get_the_title() . '</a></li>'; | |
endwhile; | |
echo '</ul>'; | |
endif; | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment