How to display more posts on Custom Post Types than regular WordPress posts?

I’m using jQuery Masonry to float my custom post type in my WordPress-theme. These posts are pretty small so I need a lot of them to fill up the page.

My problem is that I’ve stated in the settings that I don’t want to have more than 4 REGULAR blog posts (Settings -> Reading -> Blog pages show at most -> 4), so how do I make WordPress differentiate between these two?

Read More

Here’s the Query I’m using to display my posts:

<!-- Start the Loop. -->
            <div id="kampanjer-container">
                <?php
                    $args = array(
                        'post_type' => 'kampanje',
                    );
                    $kampanje = new WP_Query( $args );
                    if( $kampanje->have_posts() ) { while( $kampanje->have_posts() ) {
                            $kampanje->the_post(); ?>
                            <article class="kampanjepin">
                                <?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>
                                    <h3><?php the_title() ?></h3>
                                    <div class='content'>
                                        <?php the_content() ?>
                                    </div>
                            </article><!-- END .kampanjepin -->
                            <?php
                        }
                    }
                    else {
                        echo 'Ingen kampanjer for øyeblikket!';
                    }
                ?>
            </div><!-- END #kampanjer-container -->

Here’s what fixed it (new line on $args):

<!-- Start the Loop. -->
            <div id="kampanjer-container">
                <?php
                    $args = array(
                        'post_type' => 'kampanje',
                        'posts_per_page' => '15',
                    );

Related posts

Leave a Reply