Get post by ASC from custome field DATE picker

So what you need to do is order it by the custom value of the meta_key date value. Something like this (untested): $wp_query = new WP_Query( array( ‘post_type’ => ‘upcoming_events’, ‘order’ => ‘ASC’, ‘meta_query’ => array ( array ( ‘key’ => ‘your_custom_date_key’, ‘value’ => date(‘Y-m-d’) ) ), ‘orderby’ => ‘meta_value’ ) ); Hope that helps.

Advanced custom fields: Customise date picker’s start date (need to choose year 1500 onwards) [closed]

You can do this by customizing the plugin. You’ll want to find timepicker.js in /wp-content/plugins/acf-field-date-time-picker/js/timepicker.js And change line 21: , yearRange: “-100:+100” to your preferred range, for example: , yearRange: “-500:+100” This gives you a dropdown that, by default, goes back 500 years and forth 100, from the current year. Or you can hardcode a … Read more

Display multiple custom post types and sort them chronological by one of their fields

There is no output for this sample code because the IF statement you used will never return true, since the string ‘post_type’ will never be equal to any other string but ‘post_type’. Use get_post_type(): if ( get_post_type() == ‘eventtype1’ ) { To order by a date custom field, you will need to use the same … Read more

ACF gallery hook?

You can use the same filter, just replace the type: add_filter(‘acf/update_value/type=gallery’, ‘my_acf_update_value’, 10, 3); All fields extend the same base class, so they also share the same basic filters.

Rewrite WordPress URL to show CPT meta field data

The post type query var is the same as the post type slug by default. Untested, but this should work- function custom_rewrite_basic() { add_rewrite_rule( ‘^books/([^/]+)/([0-9]+)/([^/]+)/?’, ‘index.php?books=$matches[1]&chapter=$matches[2]’, ‘top’ ); } add_action(‘init’, ‘custom_rewrite_basic’); $matches[3] will contain the chapter slug, but if you don’t need that to retrieve the chapter, then you don’t have to set it. Rewrite … Read more