Forums

WP_Query y problemas con order (1 post)

  1. huinchaman
    Member
    Posted 9 months ago #

    Hola Foreros

    consulta tengo el siguiente probleme
    tengo este script:

    $my_wp_query = new WP_Query();

    $arg =array(
    'post_type' => 'page',
    'orderby' => 'title',
    'order' => 'DESC'
    );
    $all_wp_pages = $my_wp_query->query($arg);

    echo '

    '.print_r( $all_wp_pages,true).'
    ';

    // Get the page as an Object
    $portfolio = get_page_by_title('CORPORATIVO');

    // Filter through all pages and find Portfolio's children
    $portfolio_children = get_page_children($portfolio->ID, $all_wp_pages);

    este me devuelve todas las paginas asociadas a corporativo ( 5 ), pero pero cuando le pongo "order"=> 'asc' solo me devuelve 3 paginas ordenadas como se debe, pero no las 5 que son child de corporativo, no se si sera algun tipo de bug o estoy haciendo algo mal

    Saludos

Reply

You must log in to post.

About this Topic