Use ksort
($projectsByYear)
Of course every time you add something to the array it will need to be resorted.
Related Posts:
- visually sort ordering “custom post types” for end users
- Custom Table Column Sortable by Taxonomy Query
- How do I allow users to sort posts? [duplicate]
- Sorting results from JSON-API on custom fields
- Sort users in get_users() in custom order
- Sort by custom field value
- How to sort posts with the first 2 or 3 by latest, and the rest is random?
- Get “wp_get_nav_menu_items” to sort alphabetically [duplicate]
- Ascending sort order for monthly & category view, i.e. ?m=201204, ?cat=4
- Adding Sorting to Website?
- Sorting by tag or category
- get_terms orderby name as numbers
- Creating a category page by alphabet
- Sort a custom post type array numerically
- Sorting get_post_ancestors array
- wordpress custom_meta ordering of timestamps
- Multi-level ordering in WordPress
- Sorting for custom column in WordPress admin post table
- Help alphabetically sorting $terms from get terms(‘wpsc_product_category’
- Vertical alphabetically post columns
- Advanced custom fields sort repeater by date
- Use pre_get_posts to sort meta_key by an array of values
- Displaying posts sorting by a custom criterion
- Sorting custom post type by usermeta
- Sort posts by meta key that is serialised with other meta keys
- orderby field – list of available options?
- User Query sort on custom field then name
- WP Query sort by meta value
- Best Practices for a Completely Customizable Homepage – without plugins
- Sort alphabetically by custom field
- Sorting posts by custom field value
- How do I create a sort capability by Title, Category, Author, Date?
- how to get post order by post id wp_query?
- How to avoid duplicating same meta_value?
- Sorting/Filter posts from front-end in WordPress blog
- ‘sort_column’ => ‘menu_order’ not working
- Sort scheduled posts in ascending order by default
- How to sort by number
- change order of images attached to post
- sort items by randomness
- inner foreach loop sorting
- Sortby parameter to sort users
- Update meta_key value for a page
- Sort my event calendar by date
- Sort query_terms_list for post_tags alphabetically
- Table Sorter sort by span title?
- make two custom columns sortables
- How to display remaining post ( in post__in ) if posts are less then post per page?
- ACF pro: Group teaser by datepicker year and display custom sub fields [closed]
- Sorting in WP_List_Table class
- Sorting Posts by Taxonomy thats not within the query’s $args
- Sort an array with an ACF meta key
- Merge arrays and order set and subset as one
- display wordpress user who published a pending post of another user
- Static front page and orderby
- Advanced sorting of content in wordpress [closed]
- Sort posts by first content letter
- How to sort a WP_Query array by post_name after an array_merge();
- Grouping posts starting with same letter
- Getshopped (WP-e-commerce): show all protucts on one admin page for drag-and-drop ordering [closed]
- Sort Posts with custom meta key by default which is currently set as optional
- Sort Posts Alphabetically by Multiple Categories [duplicate]
- List CPT by menu_order with children right after parent
- How can users sort multiple pages?
- How do i Sort my Posts
- How to resort my id in wordpress?
- Orderby meta_value only returns posts that have existing meta_key
- Can I query custom meta data through WP_Query
- Sorting list of sites from multisite network using wp_get_sites
- How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?
- Limit the post for differents custom post type in the same wp_query
- assign 2 $args to one wp_query
- shortcode to create dynamic dropdown box form shortcode attributes
- Meta box io oembed returns list not array
- Defining a global array in functions.php?
- Order posts using a custom array
- get_post_type() in in_array doesn’t work for some reason
- Combining sorted and random CPT
- Nesting if statements to echo only one string based on what tag was filtered?
- How to properly loop through these external URLs to get them into the sitemap using this hook
- sanitize POST arrays
- Display post content with respect to its title?
- Custom taxonomy/category order
- Query all posts if multiple meta key don’t exist
- How to write: $wpdb->update having WHERE NOT value pair in the array
- Sort search results by Custom Field
- How do I turn these values from MYSQL into an array
- Hide sidebar if post_type is in array
- Get categories names as an array to use it in theme settings
- WordPress Include ‘print_f’ in WP_Customize_Control array [closed]
- Sort populated GravityForms list alphabetically [closed]
- Trying to select 1 item from an array
- WP Query and date format
- Dynamically adding filters
- Render shortcodes with get_post_custom
- Pass a comma separated shortcode attribute to a function
- Sort taxonomy page alphabetically by meta rather than default post date
- Get the correct meta_value with get_post_meta
- How to sort by meta value num, but ignore zero value?
- WordPress Query Returning Every Post