Skip to content

Instantly share code, notes, and snippets.

@tomfinitely
Created October 21, 2013 19:59
Show Gist options
  • Save tomfinitely/7089937 to your computer and use it in GitHub Desktop.
Save tomfinitely/7089937 to your computer and use it in GitHub Desktop.
Genesis Page/Post Hybrid with Shortcode Execution after both loops.
<?php
/**
*
* Template Name: Hybrid Template
* This file handles blog post listings within a page.
*
*/
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' => 'some-category',
'order' => 'DESC',
'order_by' => 'date',
'posts_per_page'=> '4',
);
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' );
}
add_action( 'genesis_after_loop', 'ebc_calendar_ai1ec');
function ebc_calendar_ai1ec() {
echo '<div class="calendar">'. do_shortcode('[ai1ec view="agenda"]') . '</div>';
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment