Adding sections in the ‘Pages’ post type
Adding sections in the ‘Pages’ post type
Adding sections in the ‘Pages’ post type
How to redefine the sorting of product categories by menu_order?
Ordering by a metadata subfield in WordPress?
How to orderby multiple meta fields if some fields are empty
Order posts by custom field DATE value
WP_Query orderby author__in
Assuming you are using Yoast SEO plugin – I haven’t tested this, but I think you can do something like this: (Source https://pretagteam.com/question/get-primary-category-if-more-than-one-is-selected) /* Checks for a yoast primary category, if it exists move the category to the first position in the $categories array. */ function yoast_primary_cat_as_first_cat($categories) { // Check if yoast exists and get … Read more
Dan, First a advice: don’t use query_posts to get your pages. Use get_pages instead. Here is how you can do what you are asking using get_pages. get_pages( array( ‘parent’ => 0, ‘sort_column’ => ‘menu_order’ ) ); You can also specify whether you want to sort in ascending order or in descending order. Default sorting order … Read more
If you’re using the plugin SEO Ultimate (it’s popular and I recommend using it), it has a component called Slug Optimizer that strips those types of words out of the post-slug, so if the post title is “The Dandy Warhols”, the slug would just be “dandy-warhols”. Perhaps just order by the post-slug?
So I figured out how to get what I want, but it’s still not perfect. The problem revolved around how my custom meta value was being stored – basically as a string. I needed to tell MySQL that it was a date, so it could be used to order the posts. To this end, I … Read more