Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter iconem

    (@iconem)

    Hi,

    What is needed is simply to allow passing PHP arrays in the orderby attribute like so the orderby WP_Query.

    Thanks again !

    <?php
    $args = array(
    ‘post_type’ => ‘words’,
    ‘meta_query’ => array(
    array(
    ‘key’ => ‘word_count’,
    ‘orderby’ => ‘meta_value_num’,
    ‘order’ => DESC
    ,
    ),
    array(
    ‘key’ => ‘title’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => DESC
    ),
    array(
    ‘key’ => ‘word_type’,
    ‘orderby’ => ‘meta_value’,
    ‘order’ => DESC
    ),
    ),
    );
    $query = new WP_Query( $args );
    ?>

    Plugin Author Eric Amundson

    (@sewmyheadon)

    Howdy iconem,

    Thanks for the terrific suggestion. While we don’t currently have this feature (multiple meta sorting), but I’ve added your request to our GitHub repo for Posts in Page and we’ll discuss implementing them soon.

    Issue is here:
    https://github.com/ivycat/Posts-in-Page/issues/40

    Another nice feature would be to display Private Posts using another slug.

    We’ve just added this in a feature branch and are going to test and hope to release within a week or two.

    Cheers,
    Eric

    You can do such sort through Advanced Post Types Order plugin, see this article https://www.nsp-code.com/applying-multiple-order-criteria-for-automatic-order-through-fallback-functionality/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Sort By two categories’ is closed to new replies.