Stop link being removed in menu/list when viewing that post
Stop link being removed in menu/list when viewing that post
Stop link being removed in menu/list when viewing that post
query_posts with sorting on a custom datestamp
This is very crude but should sort your posts by year (meta_value) and then by title. It does depend on how the query is setup so it will only work with the query below or with similar ones. function alter_order_wpse_103181($order,$qry) { remove_filter(‘posts_orderby’,’alter_order’,1,2); $order = explode(‘,’,$order); $order = implode( ‘ ASC,’,$order); return $order; } add_filter(‘posts_orderby’,’alter_order_wpse_103181′,1,2); $q … Read more
Weird results using wp-query with ‘date_query’ for last week
You forget $query->the_post(), which makes the same as setup_postdata(). Also you are using $post->ID inside the loop but $post is not current post object in the loop. You have also syntax errors; for example you pass thumnail to wp_get_attachment_image() instead of a string “thumbnail”, and pass name as orderby argument instead of the string “name”, … Read more
query_posts() is overly simplistic and a problematic way to modify the main query of a page by replacing it with new instance of the query. It is inefficient (re-runs SQL queries) and will outright fail in some circumstances (especially often when dealing with posts pagination). Any modern WP code should use more reliable methods, like … Read more
new WP_Query based on average values of meta fields
Sorting Posts Based On Meta Value Using AJAX
WP Query posts__in not working with array
The first version of my answer was that in general you would have to code that information yourself into the meta key itself. For example: booking_date booking_text booking_number But then I noticed the ACF tag of your question. If you have a custom field key price, then it’s ACF field key is saved to the … Read more