Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active May 23, 2017 01:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save srikat/9565d8d572d8399029e9dbcfdd2f573a to your computer and use it in GitHub Desktop.
Save srikat/9565d8d572d8399029e9dbcfdd2f573a to your computer and use it in GitHub Desktop.
<?php
add_action( 'genesis_loop', 'sk_do_loop' );
/**
* Outputs a custom loop
*
* @global mixed $paged current page number if paginated
* @return void
*/
function sk_do_loop() {
// Loop 1
$args1 = (array(
'post_type' => 'portfolio',
'posts_per_page' => 3,
'no_found_rows' => true
));
echo '<h2 class="loop-title">Portfolio</h2>';
genesis_custom_loop( $args1 );
// Loop 2
$args2 = (array(
'tag' => 'project',
'posts_per_page' => 6,
'no_found_rows' => true
));
echo '<h2 class="loop-title">Projects</h2>';
genesis_custom_loop( $args2 );
}
genesis();
.loop-title {
background-color: #000;
color: #fff;
margin-bottom: 40px;
padding: 10px 20px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment