Changeset 2920 for sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/query-modifications.php
- Timestamp:
- 04/08/2016 02:50:47 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/query-modifications.php
r2883 r2920 64 64 ); 65 65 66 // Allow some themes to always be featured by setting a postmeta key. 67 // By searching for themes with both EXISTS and NOT EXISTS we can query for the existence (and then sort) or the non-existence. 68 $query->query_vars['meta_query'] = array( 69 array( 70 'key' => '_featured', 71 'meta_compare' => 'EXISTS' 72 ), 73 array( 74 'key' => '_featured', 75 'compare' => 'NOT EXISTS' 76 ), 77 'relation' => 'OR' 78 ); 79 $query->query_vars['orderby'] = 'meta_value_num DESC, RAND(' . date( 'Ymd' ) . ')'; 66 // Some themes are always featured by ways of the menu_order 67 $query->query_vars['orderby'] = 'menu_order DESC, RAND(' . date( 'Ymd' ) . ')'; 80 68 $query->query_vars['no_found_rows'] = true; 81 69 break;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)