Your Problem isn’t that big. As your meta data is stored in the Y m D format, you should be able to just sort by it (I am going to assume that the format uses leading zeros).
You just add “meta_key” to your query arguments like this:
$args2 = array(
'post_type' => 'joblist',
'post_status' => 'publish',
'showposts' => -1,
'order' => 'ASC',
'meta_key' => 'completion_date', //change for the correct meta key
'orderby' => 'meta_value_num'
);
$slider_loop2 = new WP_Query($args2);
Be aware: because WordPress uses an INNER JOIN to join the two tables, with this query there will be NO Posts, that do NOT possess this meta value. So if there are Posts that don’t have that value set, they will not be in your query.
Happy Coding!
Related Posts:
- Can i use php sql functions instead of $wpdb?
- Why include a composer.json file with my plugin?
- Getting paginate_links() ‘end_size’ to display none
- What is the best practice for escaping data URIs?
- WordPress Template Engine?
- Display only text to WordPress loop without loosing the text formatting
- Making a follow button, Ajax not talking to php
- Replace existing content from specific WooCommerce admin orders list column
- How do I get images (with a thumbnail preview) to show in search results?
- How to display blog images using wordpress in existing project
- How do I translate this string – PHP syntax question
- PHPCS: Strings should have translatable content
- mysqli_real_connect() – authentication method unknown to the client Warnings
- php syntax – how to concatenate properly – echo bloginfo(‘stylesheet_directory)
- how to increase custom post value by one most efficiently?
- multiple if statements [closed]
- Escape post image attachments added to template
- Woocommerce product download URL
- Multiple choice in a custom taxonomy
- Calculations in functions.php [closed]
- Get_avatar filter?
- WordPress custom login form using Ajax
- WP dynamic featured image – Can’t get second featured image url
- Why is my cookie not unsetting upon logout? [closed]
- How to remove role=”navigation” from all nav elements?
- How to use $_GET function WordPress backend
- How to set variable, pass it to a partial file and remove it after?
- Dynamic content in template
- register_taxonomy() take much queries
- wp_dropdown_pages auto submit
- WooCommerce Tabs [closed]
- Limit checklist by the current user
- Adding Meta Tags to a Post using its Tags, Excerpt and content
- Use Tags to initiate Search
- Show About and Contact Us page when they’re clicked in the top menu.
- single.php with different look by category
- WordPress Block developer from exporting Database via PHP
- Displaying posts based on category
- Changing the color scheme based on the url visited
- How to send form data from WordPress (Meta Box) to an OData service?
- Issue with custom loop in Archive page
- WooCommerce pages looks unstyled
- class ‘wphpc_PAnD’ not found
- Accessing values from ACF sub field (flexible content area) in PHP
- Creating an image from a custom field
- home.php show blog posts as grid view
- Custom post type permalinks do not appear using the link functions
- Loading Posts & Category with Ajax
- How to organize functions.php content
- List all anchor links on a page
- Assign Custom classes to every Excerpt
- Adding a ‘style=’ bit to image_send_to_editor output
- Auto create Nextgen Gallery on post creation [closed]
- Adding a navigation page state to individual blog and portfolio pages
- Inline CSS header style priority function.php Child (no enqueing I think)
- Display Post Title From Select Choice Loop in Advanced Custom Fields (ACF) – WordPress
- orderby meta_value_num is not working, giving default order
- Jetengine Forms – Media upload path
- Contain multiple page templates in one PHP custom template file in WordPress?
- url not using query string no longer working
- How do I reopen the (Popup Maker) after entering the correct password for a password protected page?
- Display div if category has a specific parent
- Custom plugin: how do I call a PHP file if settings option is set to true?
- I want it to detect the duplicate comment and give a warning on the same page
- How to identify which php file a plugin is using on page load?
- How to edit button permalink inside function.php using a child theme?
- How to switch between two primary menus (programatically0
- Why am I getting syntax error, unexpected ‘endwhile’ (T_ENDWHILE) on single.php
- Elementor to custom wordpress page
- custom post type not showed with bootstrap 4 modal and template part
- Conditionally change WordPress core language
- Remove item from post_meta array via AJAX
- Shortcode just with a php code
- CSS loading as empty file in Custom Theme
- Calling WordPress hook from within a class: call to undefined function error
- wp_send_json erase last value
- PHP array to jQuery array ” Uncaught SyntaxError: Unexpected token < "
- I want show only data for today
- How can I customize a WordPress theme before it’s downloaded?
- Permalinks and custom PHP application
- Updating meta_value in a custom key
- rewrite_rule – working fine but broken for pagination
- AdWords API with WP
- Add title and caption to thumbnail image on mouseover
- Postmeta not saving
- WordPress wp_remote_post() sending informaiton to Redmine REST API
- Missing items on page
- WordPress rewrite question
- Using Nonce for my Form
- WordPress blog set up
- Cannot get custom javascript to execute on page
- How to declare a variable at the bottom of the page and use its value at the top?
- Shortcode working in page.php but not in category.php in wordpress
- How can a ‘scripts’ directory be hooked into wp_head();?
- Display Current Time using shortcode
- WP and Laravel integration (Updated) [closed]
- How to limit the number of posts in the wordpress loop in conjunction with the “download more” button?
- seo meta description issue in google search
- WordPress Query – Blog Cards Duplicate issue
- PHP Works only for logged in users: [closed]