D
D
Denis Bukreev2015-11-14 12:13:17
PHP
Denis Bukreev, 2015-11-14 12:13:17

WordPress. How to sort query from database?

There is this code:

<?php 
#html<?
// WP_Query arguments
$args = array (
  'post_parent'           => '371',
  'post_type'              => 'page',

);

// The Query
$query = new WP_Query( $args );

// The Loop
if ( $query->have_posts() ) {
  while ( $query->have_posts() ) {
  $query->the_post();

#?>html

This query returns two records.
How can I sort them in reverse order? What to add to the code

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sunsvision, 2015-11-14
@denisbookreev

order, orderby https://codex.wordpress.org/Class_Reference/WP_Que...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question