Hi all "Want to do it without plugin" Firstly how can I create a custom field in my custom post type where I can get the date // Our custom post type function function create_posttype() { register_post_type( '', // CPT Options array( 'labels' => array( 'name' => __( 'Archive' ), ), 'public' => true, 'has_archive' => true, 'rewrite' => array('slug' => 'Archive'), 'show_in_rest' => true, ) ); } // Hooking up our function to theme setup add_action( 'init', 'create_posttype' ); I want to fetch the posts which has date in "Custom post" before the current date. Example -> If in the custom field I entered 2021-12-25 and it's before the current date then the post should be fetched and after the current date crossed 2021-12-25 post should not be fetched.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)