Answer the question
In order to leave comments, you need to log in
How to display records with the ability to sort for the user?
Good afternoon, evening.
I'm looking for help in the task, maybe someone will tell you where to look or what plugin to use.
The site will have several sections with entries.
(Plays, scripts, articles)
I need to display entries from the selected category on the page. But not just display, but make it possible to sort for visitors by creation date or alphabetically (post name) with pagination.
Answer the question
In order to leave comments, you need to log in
$args = array( 'posts_per_page' => -1, 'orderby'=> 'title', 'order' => 'ASC' );
$my_query = new WP_Query( $args );
if ( $my_query->have_posts() ) :
while ( $my_query->have_posts() ) : $my_query->the_post();
// do stuff here
endwhile;
endif;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question