It might be easier if you rearranged how you’re going about this. Rather than putting a numerical value for the title, why not put it as a custom field. You can still show all your posts and orderby your custom field as a numerical value using meta_value_num. More info.
Here’s a topic on the WordPress Support forums for someone trying to accomplish the same thing: http://wordpress.org/support/topic/orderby-title-doesnt-sort-numbers-correctly?replies=38
Please note what user esmi says:
Can I point out that:
[…]
correct from a programming pov? Those “numbers” are actually strings –
not numeric integers.
PS — echo '<h1>$'. $ammount . '</h3>'; should be echo '<h1>$'. $ammount . '</h1>';
Related Posts:
- Only get_posts of certain post formats
- Is the first item returned by get_posts() always the latest post?
- Why can I not use setup_postdata($post) in the sidebar?
- Display sorting options dropdown when using WooCommerce product category shortcode
- How to retrieve a value from get_posts()? [closed]
- Drop down+sort blog posts date added/most popular
- What is the most efficient way to search users by their display name?
- Archive listing of posts by publish year (multiple years)
- Getting movie and serial on actor page
- how to display active, upcoming and past event with featured listing with pagination
- Display 4 chronological posts starting with a random post
- Sortable admin column for one meta key with three possible meta values
- How do I output a database option that is an array into a get_posts array?
- list posts and wrap them alphabetically A-Z
- Advanced Custom Fields: Post Object – Not returning data [closed]
- Order posts randomly, not by date
- Nesting if statements to echo only one string based on what tag was filtered?
- Why not yield/iterable in posts interface?
- Sort posts by custom fields value using dropdown menu
- How to Sort posts by Vote Count?
- Logged in user ID as post ID
- Sort query_posts for Parent Pages to menue order or the count?
- How to sort posts based on the value (number) of a post’s metadata?
- Sort custom meta column by other meta value
- Sort the result of the main Query in shop page by a custom taxonomy
- How do I exclude recent post from recent post php widget
- Open post-content in archive page in a Modal box with bootstrap
- get_posts() and WP_query limits ‘AND’ conditions to a maximum of 6 for meta value queries in WordPress
- Query if audio attachment AND/OR custom field
- How do I get post attachments in menu_order in WordPress?
- Sort by page information by Ascending Numbers
- PHP Syntax Error on get_posts
- How i can get post data from database when i am getting post id from url in wordpress
- How to retrive the text : No movie by this actor
- How to keep track of when a vote is cast?
- change the default order of posts only for specific categories
- How to get image from url from the database?
- Order BY Most Liked And Published Between Previous Week Monday And Next Week Monday
- How to tag the main tag? [closed]
- Removing custom sort order from admin page listing
- Unable to render custom field after attempt to generate a list of recent post in page template
- Add class to every other posts using get_posts
- search.php to search only the post title
- How to get woocommerce orders with get_posts method in a shortcode
- get value from get_post_meta then reuse it in another get_post_meta
- WordPress sorting posts by date and title using a dropdown
- Foreach Loop Of Post Types With Nested If Else If Not Completing Process
- How can I render more than multiple posts on template-parts with post formats
- How to sort (orderby) a query done by a template function before the ‘foreach’ loop?
- How to display post_content from database in different on template page?
- Displaying POST content with HTML tags and all
- Array sorting assistance
- Create a hierarchical loop at predefined markup requirements
- offset and max_num_pages in pagination gallery
- Even with PHP plugin get_posts not working in widget area
- Page 2+ of taxonomy archives does not recognise sort-order from dropdown
- Query category-specific, paginated posts and allow viewer to change sort order
- WordPress – show all posts + ones with specific tag
- Transient Loop Not working as expected
- show/hide attachments
- ISOTOPE – Missing/Invalid Arguement Get Terms
- Posts sortable column not sorting properly for custom field numbers
- category & sub category order issues in wordpress
- Sort author list alphabetically
- Find owner of coupon
- Link on post title only if post have content
- What is wrong with my sorting logic?
- Category Attachment Pagination 404 Error on 2nd Page
- Remove update nags for non-admins [duplicate]
- Integrating WordPress to my website, while keeping my own authentication system
- Update Custom Field on Imported Post Creation
- Using a javascript file to access a get posts array
- spliting posts into two columns
- Ajax return code 400
- Customising the search function?
- Show wp_die if url form comment not emply
- Create an if is_page statement based on parent page
- do_shortcode with custom field
- Detecting if parent page has gallery
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- Removing WordPress Footer -without access to PHP code?
- Post repeated when opening in overlay, how do I solve this? [closed]
- Woocommerce: remove total sum from new order’s email [closed]
- Trying to display text in a block in a plugin page
- how to hide or disable some part in specify page
- Include a file that has a function in it
- making my own “related pages” / “pages you might like” section
- Contain multiple page templates in one PHP custom template file in WordPress?
- How to edit button permalink inside function.php using a child theme?
- Elementor to custom wordpress page
- custom post type not showed with bootstrap 4 modal and template part
- Shortcode just with a php code
- wp_send_json erase last value
- PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "
- How can I customize a WordPress theme before it’s downloaded?
- AdWords API with WP
- Add title and caption to thumbnail image on mouseover
- Global variables and re-use
- FATAL ERROR , Sommerce Theme [closed]
- Connection refused by WordPress