Wordpress - позволяет в раскрывающемся списке изменять сообщения, отображаемые пользователю - PullRequest
0 голосов
/ 25 марта 2020

https://i.stack.imgur.com/KsgdT.png

Привет, я пытаюсь позволить пользователю выбрать, сколько сообщений он хочет видеть на сайте. Параметры будут аналогичны приведенному выше изображению (10, 20 или 30).

Я использую тему _s в качестве стартовой, так что на данный момент она довольно пуста. Код для моего индекса:

<main id="main" class="site-main">
    <h1 class="page-title screen-reader-text"><?php single_post_title(); ?></h1>
        <?php
        if ( have_posts() ) :
            /* Start the Loop */
            while ( have_posts() ) :
                the_post();

                /*
                 * Include the Post-Type-specific template for the content.
                 * If you want to override this in a child theme, then include a file
                 * called content-___.php (where ___ is the Post Type name) and that will be used instead.
                 */
                get_template_part( 'template-parts/content', get_post_type() );

            endwhile;

            // the_posts_navigation();
            // Maybe the code for the dropdown should go here?
        else :

            get_template_part( 'template-parts/content', 'none' );

        endif;
        ?>

</main><!-- #main -->

Благодарим вас за то, что кто-то может показать мне, что для этого нужно сделать.

Заранее спасибо

...