Skip to content

Instantly share code, notes, and snippets.

@nickcernis
Created October 17, 2014 19:00
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 nickcernis/689f54fcaa5fc13e0925 to your computer and use it in GitHub Desktop.
Save nickcernis/689f54fcaa5fc13e0925 to your computer and use it in GitHub Desktop.
A custom loop that displays one post on the Genesis Blog template
<?php
// Template Name: Blog
remove_action( 'genesis_loop', 'genesis_do_loop' );
add_action( 'genesis_loop', 'newspro_do_custom_loop' );
function newspro_do_custom_loop() {
global $paged;
global $query_args;
$args = array(
'posts_per_page' => 1,
'paged' => $paged,
);
genesis_custom_loop( wp_parse_args( $query_args, $args ) );
}
genesis();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment