WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #17065, comment 55


Ignore:
Timestamp:
01/16/2014 11:32:05 PM (6 years ago)
Author:
toto
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17065, comment 55

    initial v1  
    55}}}
    66is very good how to use it?
    7 Can i use sql hack for now?
     7
     8
     9Now im using this hack to order multiple:
     10
     11
     12{{{
     13        'orderby'       => 'post_name meta_value_num',
     14        'order'         => 'DESC',
     15}}}
     16
     17And add this hack
     18
     19
     20{{{
     21add_filter( 'posts_orderby', 'filter_query', 999);
     22function filter_query( $query ) {
     23    $query .= ', '.$wpdb->posts.post_name.' ASC';
     24    return $query;
     25}
     26}}}
     27Here we can order meta_value_num width 'order'         => 'DESC',
     28and we can order - post_name width the hack.
     29
     30
     31
     32