Skip to content

Instantly share code, notes, and snippets.

@jamiemitchell
Last active February 3, 2017 17:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jamiemitchell/10957259 to your computer and use it in GitHub Desktop.
Save jamiemitchell/10957259 to your computer and use it in GitHub Desktop.
Replace default loop with genesis_custom_loop
<?php
remove_action('genesis_loop', 'genesis_do_loop');
add_action('genesis_loop', 'custom_do_loop');
function custom_do_loop() {
global $paged;
$args = array(
'post_type' => 'portfolio',
'order' => 'DESC',
'posts_per_page' => 4
);
genesis_custom_loop( $args );
}
genesis();
@jamiemitchell
Copy link
Author

This basically turns the default Genesis loop to a custom loop so you can still use the Genesis hooks to remove and move stuff around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment