Two Custom Loops: One For Sticky Posts and One Without


remove_action('genesis_loop', 'genesis_do_loop');

add_action('genesis_loop', 'custom_sticky_loop', 9);
function custom_sticky_loop() { 
	if ( !is_paged() ) {
	
		// Get all sticky posts
		$sticky = get_option( 'sticky_posts' );
		// Sort the stickies with the newest ones at the top
		rsort( $sticky );  
		// Query sticky posts
		$args = array( 
			'post__in' => $sticky, 
			'caller_get_posts' => 1,
			'showposts' => -1 
		);
	
		genesis_custom_loop( $args );
		
		
	}
}


add_action('genesis_loop', 'custom_loop');
function custom_loop() {

    global $paged;
    // No sticky posts in this loop
    $args = array(
    	'post__not_in' =>get_option("sticky_posts"),
    	'paged' => $paged
    );
	
    genesis_custom_loop( $args );

}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>