For Future Posts, you can just have Published Posts that are scheduled for the future. When editing a post, you can click on Edit
beside “Publish Immediately” and select a date/time.
You can then have a subloop get all posts with the post_status
of future
. That should work just fine for you!
Future:
$query = new WP_Query( array(
'post_status' => 'future',
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 1
) );
if( $query->have_posts() ) {
while( $query->have_posts() ) {
$query->the_post();
echo the_title();
}
}
Oldest
$query = new WP_Query( array(
'orderby' => 'date',
'order' => 'ASC',
'posts_per_page' => 1
) );
if( $query->have_posts() ) {
while( $query->have_posts() ) {
$query->the_post();
echo the_title();
}
}
Related Posts:
- functions.php conditional tag only for custom post type
- Is it possible to use array_walk() to append terms to an array of posts?
- Redirect to URL if x number of days passed
- $_SESSION Not working after X amount of page views
- How to I add count of custom posts listed in a post as a prefix to its title
- How do test if a post is a custom post type?
- How to get post content by calling ajax?
- Displaying Custom Post Types In “At A Glance” Meta Box
- Display a query with multiple post types and same relationship on a single page
- how to group custom post types
- echo value from ‘select’ field type into page template using cmb2?
- Exclude add_filter from the admin
- WordPress 3.1 – How does one add sticky post capabilities to post types
- Retrieving 3 latest post from each of 5 different custom post types
- Posts to expire (deleted) after a date
- White screen error for a custom theme
- Automatically assign a custom post to a custom taxonomy based on custom field value
- Exclude Custom Post Type & Pages From Auto-Tag Function
- Custom user role not working as expected
- Quickest way to get last or oldest post date – WP Query
- Need functionality with all post list available at edit.php
- is_page_template not working as expected
- Remove default post types on all sites except primary blog. WPMU
- How to change the admin menu “Pages” to something else
- Apply post formats to a specific post type only?
- Loading all files within a directory
- Custom Post Types relationships
- Copy custom field value to post title
- Insert HTML inside link in a walker
- Function to display custom post type on front page makes menu items dissapear
- Can I list a custom post type within another custom post type in the admin area?
- Is there a conditional tag to determine whether the post is _any_ custom post type?
- Set URL link to featured image of custom post type
- Redirect 404 page with ID in slug to associated page with same ID in slug
- Stuck in Order by more then one
- Display featured image from one CPT within another CPT query
- create a new page from a custom post type similar to an authors page
- Anon function and add_meta_box
- Shortcode not working with post counter
- Changing default ‘posts’ parameters with register_post_type_args
- Multiple (two) category postings on the same page.
- ‘exclude’ argument is not working with get_posts for a custom post type
- Allow users to create posts without logging in?
- Load scripts based on post type
- Meta-Boxes for CustomPostType cause PHP Errors and Notices in “Add New” view
- Warning: Invalid argument supplied for foreach() in post.php [closed]
- Get only used meta_values
- custom post type metaboxes not saving
- Enable taxonomies by post type in an array of CPTs
- Showing custom post type categories in the menu
- How to use a variable as a function name?
- Displaying multiple post types on home page
- Run shortcode in custom script in wp_head if post type is CPT ‘Jobs’
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- Get post format
- posts within custom post type all share the same content in the front-end
- Using Wp_Query, Json to add Highcharts series data
- Template code to split a post and print a custom field?
- Send post changes to set email addresses (not users or subscribers)
- Let users upload image(s) to the post from front end
- Have custom post type Visibility be private by default, and have radio button also set to “Private”
- If tag exists, then echo once
- Post visibility option to theme front-end for author to select?
- Sorting custom post types in edit.php : Post disappear
- display custom portfolio tags
- Page template that uses lightbox to display post images
- Display a random customposttype2 excerpt in single-custompostype1.php that shares same taxonomy
- Function to allow single post template based on custom taxonomy?
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- What is the best way to set the post category (Custom Post Type) automatically based on the one of the tags assigned to the post?
- Custom Form / Search with Custom Post Type Data
- php dynamic content inside shortcode
- Check that a slug is present in the get_terms request
- get_posts wont produce a list of custom type from a given category [duplicate]
- Custom attachment function not working in v5.4.2?
- Cannot display the_content() after removed WordPress 5’s auto embed feature (iframe & blockquote)
- Update main post with same category when creating custom post to update the modified date
- CPT tags not showing when editing post
- Attend event form with ajax
- Persist meta box choices throughout all posts of same post type
- Query a custom taxonomy in a function to create an csv file
- How to add custom PHP code in post header?
- subtracting the current post form then whole loop, which is generating all CPT titles
- Custom Function to redirect singular post if specific meta field is empty
- week days sorting based on starting day
- Function for when new custom post type is created should do something
- When post is Published, insert into custom table a number – custom post type
- Getting a 404 on single custom post type page when using rewrite on a custom taxonomy
- Custom metabox fields not saving when limited to a certain CPT
- Pagination fault in custom post type archive page [duplicate]
- How can i call a custom method on submission of a custom plugin post type?
- Function not pulling image or text from custom post type
- Diffrent search templates for different post types
- Rich Custom Field for Custom Post type not saving
- Can’t preview custom post – Redirected to home page
- How do I display the index position of a post from a custom post type?
- Post AND page parameter for WP function
- How to string lines from the_content() hook in WordPress?
- Passing postid of Testimonial Custom Post in Shortcode Parameter
- How to use wp_set_object_terms depending on page ID?