Skip to content

Instantly share code, notes, and snippets.

@braddalton
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save braddalton/3682be9dcc6d3ba32ea0 to your computer and use it in GitHub Desktop.
Save braddalton/3682be9dcc6d3ba32ea0 to your computer and use it in GitHub Desktop.
<?php
/*
Template Name: Custom Loop
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'custom_query' );
function custom_query() {
global $paged;
global $query_args;
$args = array(
'post_type' => 'portfolio',
'posts_per_page' => '6',
'post_status' => 'publish',
'paged' => $paged,
'orderby' => 'rand'
);
//* Remove the entry meta in the entry header
remove_action( 'genesis_entry_header', 'genesis_post_info', 5 );
//* Remove the entry meta in the entry footer
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_open', 5 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
remove_action( 'genesis_entry_footer', 'genesis_entry_footer_markup_close', 15 );
echo '<div class="communities">';
genesis_custom_loop( wp_parse_args($query_args, $args) );
echo '</div>';
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment