Created
January 6, 2016 19:40
-
-
Save corenominal/c0d64d2e52a98313309e to your computer and use it in GitHub Desktop.
An example WordPress custom loop to show all custom post types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Set-up the loop with all custom post types | |
$post_types = array( 'post', 'link', 'snippet', 'doodle' ); | |
$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1; | |
$args = array( | |
'post_type' => $post_types, | |
'paged' => $paged, | |
'posts_per_page' => 10 | |
); | |
query_posts( $args ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment