开发者

Wordpress Magic fields dropdownlist limit of values

开发者 https://www.devze.com 2023-03-12 01:05 出处:网络
Hy guys, i created a dropdownlist by getting values from magic fields: <?php $dvs = new WP_Query(); ?>

Hy guys,

i created a dropdownlist by getting values from magic fields:

<?php $dvs = new WP_Query(); ?>
<?php $dvs->query('cat=3'); ?>

    <开发者_开发知识库;div class="dvs-menu">

        <!-- List -->

        <p>VS</p>

        <select id="dvs-list">
            <?php while($dvs->have_posts()) : $dvs->the_post(); ?>
                <option class="dvs-list" title="dvs-<?php echo get('dvs_year'); ?>" value="<?php echo get('dvs_year'); ?>">
                    <?php echo get('dvs_year'); ?>
                </option>
                <?php endwhile; // End the loop. Whew. ?>
        </select>

    </div>

I have about 20 values in there, but whatever i do, only 10 will be shown. Is that a problem of WP, MF or the browser?


I think you're hitting the standard pagination limit (10 posts per page.) Pagination is on by default (makes sense for most Loops) but obviously it's not a good option for your dropdown list.

Try adding the nopaging option to disable pagination:

<?php $dvs->query('cat=3&nopaging=1'); ?>

See the docs for more details.

0

精彩评论

暂无评论...
验证码 换一张
取 消