Answer the question
In order to leave comments, you need to log in
Displaying all WordPress posts?
I need that in the form of sending a person could select the name of the record, that is, in the form there is a select, and in it all the records of the site, the person selects the desired record.
Please help)
Probably the question is easy, but I can not understand how to do it.
Answer the question
In order to leave comments, you need to log in
Are you so afraid of Yandex and Google, this sweet couple, or just a beer belly does not allow you to do anything extra???!!
<?php
// запрос
$wpb_all_query = new WP_Query(array('post_type'=>'post', 'post_status'=>'publish', 'posts_per_page'=>-1)); ?>
<?php if ( $wpb_all_query->have_posts() ) : ?>
<ul>
<!-- the loop -->
<?php while ( $wpb_all_query->have_posts() ) : $wpb_all_query->the_post(); ?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; ?>
<!-- end of the loop -->
</ul>
<?php wp_reset_postdata(); ?>
<?php else : ?>
<p><?php _e( 'Извините, нет записей, соответствуюших Вашему запросу.' ); ?></p>
<?php endif; ?>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question