Skip to content

Instantly share code, notes, and snippets.

@electricbrick
Created October 22, 2013 18:58
Show Gist options
  • Save electricbrick/7106139 to your computer and use it in GitHub Desktop.
Save electricbrick/7106139 to your computer and use it in GitHub Desktop.
Tonight's Menu
<?php
/**
* Template Name: Tonight's Menu
* 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' => 'tonights-menu',
'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