Created
September 5, 2013 20:17
-
-
Save tomfinitely/6455575 to your computer and use it in GitHub Desktop.
Daily Specials Code
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
<?php | |
/** | |
* Template Name: Daily Specials | |
* Description: Used as a page template to show page contents, followed by a loop through a CPT archive | |
*/ | |
remove_action('genesis_loop', 'genesis_do_loop'); | |
add_action('genesis_loop', 'custom_do_cat_loop'); | |
/** Remove Post Info */ | |
remove_action('genesis_after_post_content','genesis_post_info'); | |
remove_action('genesis_after_post_content','genesis_post_meta'); | |
function custom_do_cat_loop() { | |
global $query_args; // any wp_query() args | |
$args= array( | |
'category_name' => 'daily-specials', | |
'order' => 'DESC', | |
'order_by' => 'date', | |
'posts_per_page'=> '1', | |
); | |
genesis_custom_loop(wp_parse_args($query_args, $args)); | |
} | |
add_action( 'genesis_before', 'child_conditional_actions' ); | |
function child_conditional_actions() { | |
//put your actions here | |
remove_action( 'genesis_post_content', 'genesis_do_post_content' ); | |
remove_action( 'genesis_post_content', 'genesis_do_post_image' ); | |
add_action( 'genesis_post_content', 'the_content' ); | |
} | |
genesis(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment