Sorting by date not working?
Sorting by date not working?
Sorting by date not working?
You can’t change the DESC to ASC “within the IF statement”. The query has already ran at that point. I don’t really understand what the code is meant to do though. I don’t really see that code ever producing the pattern you describe. Specifically, I don’t understand what the shortcode strings or for or how … Read more
How to add product thumbnail on orders list on backend?
As with any custom tables in your database, you can override the SQL that WP_Query ends up using. For this use case, I’d suggest not using WP_Query’s arguments and building your own function to do this instead as it could simplify the logic and complexity. <?php add_filter( ‘posts_clauses’, ‘my_custom_wp_query_posts_clauses’, 10, 2 ); /** * Custom … Read more
Order Wp Query by earliest of 3 dates meta query
Get posts that were most recently tagged
This can be achievable by writing your own custom function. What you need to do is use the get_terms() object to do your query order by terms. When making a custom function, check your specific term id set as a parameter and then according to that remove that term id and add it back. I … Read more
Thanks to @cameronjonesweb’s link, here’s the code you might use: add_filter( ‘manage_edit-post_sortable_columns’, ‘my_add_sortable_custom_column’); function my_add_sortable_custom_column( $columns ) { $columns[‘views’] = ‘views’; return $columns; } add_action( ‘pre_get_posts’, ‘my_sort_custom_column’ ); function my_sort_custom_column( $query ) { if( ! is_admin() || ! $query->is_main_query() ) { return; } if ( ‘views’ === $query->get( ‘orderby’) ) { $query->set( ‘orderby’, ‘meta_value’ ); … Read more
You can’t order by taxonomy terms, the very concept breaks down when you try to handle posts that have multiple terms in a taxonomy. You may know that only 1 term will ever be selected but WP_Query isn’t built that way. Instead, keep your taxonomy so that you retain all the performance/theming/Admin UI benefits, but … Read more
If it’s greyed out it’s because you haven’t created a menu yet. Once you give it a name and save it, you should be able to add pages and links to your menu. Once you have links/pages, you can begin to sort the menu by dragging them up or down.