Ive an array set up to filter through various categories, currently it is only displaying 10 a maximum of ten posts instead of all of them. Where have i gone wrong?

<div class="select-search">

    <div class="ten columns beer-filter">
    <form  id="category-select" class="select-search" action="<?php echo esc_url( home_url( "https://wordpress.stackexchange.com/" ) ); ?>" method="get">

        <?php
        $args = array(
            'show_option_none' => __( 'Filter By Beer Type:' ),
            'show_count'       => 1,
            'orderby'          => 'name',
            'echo'             => 0,
            'child_of'           => 2,
            'exclude' => '',
        );
        ?>

        <?php $select  = wp_dropdown_categories( $args ); ?>
        <?php $replace = "<select$1 onchange="return this.form.submit()">"; ?>
        <?php $select  = preg_replace( '#<select([^>]*)>#', $replace, $select ); ?>

        <?php echo $select; ?>

        <noscript>
            <input type="submit" value="View" />
        </noscript>

    </form>

    </div>
    <div class="two columns"><a href="http://beerinbelfast.com/beers/"><button class="filter-button">Reset</button></a></div>

</div>

Thanks

1 Answer
1

I don’t see where your posts are pulling from, just the category list, but you are most likely missing the post_count variable where you have your query args to retrieve the posts. post_count=-1 will return all, but it defaults to 10 (or whatever is set in your settings) if you do not specifically say otherwise.

Leave a Reply

Your email address will not be published. Required fields are marked *