Custom Post Type in index.php loop and navigation problem
-
I have tried several codes to get the custom post type called in my index file loop that also works with the page navigation. If someone could maybe review these code snippets and tell me what I’m doing wrong I’d really appreciate it.
First code snippet – calling custom post type works, but page navigation doesn’t:
<?php // on front page $args = array( 'post_type' => array('post','events'), ); query_posts($args); ?>
Second code snippet – Page navigation works but the custom post type -events- is not displaying:
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts( array( 'post_type' => array('post','events'), 'posts_per_page' => 10, 'orderby' => 'date', 'order' => 'DESC' ).get_option('posts_per_page').'&paged=' . $paged ); ?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Custom Post Type in index.php loop and navigation problem’ is closed to new replies.