I have several standard posts and posts from a custom posts type. Now I want to display all of them on my home page using a loop. My problem is that it displays the posts including the posts from the custom post type, but not all.
Types of posts I have right now: 7 standard posts, 15 Photos, 5 Videos, 2 Webs. Total of 29 posts.
In my Reading settings, I have set the blogs pages to show at most to 6 posts. Now when I go to the home page, I can see those 6 posts mixed with different post types but there are only 2 pages (the 2nd page also consist of 6 posts). Meaning, there are only less than 13 posts where it actuality, I have 29 total posts. When I go to website.com/page/3/ I get a 404 error.
I am using the latest FoundationPress framework for my WordPress theme and here's my code
<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $loop = new WP_Query(array( 'post_type' => array('post', 'photo', 'video', 'web'), 'posts_per_page' => get_option('posts_per_page'), 'paged' => $paged )); ?> <?php while ( $loop -> have_posts() ) : $loop -> the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?>
Just for reference, here's the FoundationPress function to show the navigation
$paginate_links = paginate_links( array( 'base' => str_replace( $big, '%#%', html_entity_decode( get_pagenum_link( $big ) ) ), 'current' => max( 1, get_query_var( 'paged' ) ), 'total' => $wp_query->max_num_pages, 'mid_size' => 5, 'prev_next' => true, 'prev_text' => __( '«', 'foundationpress' ), 'next_text' => __( '»', 'foundationpress' ), 'type' => 'list', ) );