小编use*_*715的帖子

WordPress循环中的随机顺序?

我在分类存档(艺术家)中使用基本循环代码,我想知道如何设置循环以随机顺序显示帖子('orderby'=>'rand')它似乎不起作用我添加数组?任何帮助都会很棒!

        <?php
                // Start the Loop.
                while ( have_posts() ) : the_post();

                    /*
                     * Include the post format-specific template for the content. If you want to
                     * use this in a child theme, then include a file called called content-___.php
                     * (where ___ is the post format) and that will be used instead.
                     */
                    array ( 'orderby' => 'RAND' );
                    get_template_part( 'content', get_post_format() );

                endwhile;
                // Previous/next page navigation.
                twentyfourteen_paging_nav();

            else :
                // If no content, include the "No posts …
Run Code Online (Sandbox Code Playgroud)

php wordpress loops

4
推荐指数
1
解决办法
7111
查看次数

标签 统计

loops ×1

php ×1

wordpress ×1