-
-
Save jamiemitchell/6987206 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 | |
| /** | |
| * Template Name: Category Listing | |
| * | |
| * @package BE_Genesis_Child | |
| * @since 1.0.0 | |
| * @link https://github.com/billerickson/BE-Genesis-Child | |
| * @author Bill Erickson <bill@billerickson.net> | |
| * @copyright Copyright (c) 2011, Bill Erickson | |
| * @license http://opensource.org/licenses/gpl-2.0.php GNU Public License | |
| * | |
| */ | |
| /** | |
| * Category Listing Loop | |
| * | |
| */ | |
| function be_category_listing_loop() { | |
| global $post; | |
| $args = array( | |
| 'post_type' => 'my_cpt', | |
| 'tax_query' => array( | |
| array( | |
| 'taxonomy' => 'cpt_category', | |
| 'fields' => 'slug', | |
| 'terms' => esc_attr( get_post_meta( $post->ID, 'be_category_listing', true ) ), | |
| ) | |
| ) | |
| ); | |
| genesis_custom_loop( $args ); | |
| } | |
| add_action( 'genesis_loop', 'be_category_listing_loop' ); | |
| remove_action( 'genesis_loop', 'genesis_do_loop' ); | |
| genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment