Try this
<?php
$args = array(
'post_type'=>'weather_today',
'orderby'=>'ID',
'order'=>'ASC',
'posts_per_page'=>1
);
$query = new WP_Query( $args );
while ( $query->have_posts() ) : $query->the_post();
//loop
endwhile;
wp_reset_postdata();
?>
Related Posts:
- Order by DESC, ASC in custom WP_Query
- Exclude or Include category ids in WP_Query
- Secondary Sort (fallback) for WP_Query
- Changing the meta_query of the main query based on custom query_vars and using pre_get_posts
- Query Posts in a Predefined Order
- WP_Query based on URL parameters
- Order by meta_value_num DESC and meta_value ASC on WP 4.0
- How to query for a week using key => value WP_Query argument notation?
- How to use filter hook posts_join for querying taxonomy terms in posts_where?
- How can I style future post?
- List taxonomy terms plus their latest post ordered by post date
- WordPress altering my custom query, How to fix it?
- Looping through tabular data
- Order by meta_key in custom post type doesn’t affect the query
- Is there a PHP function that can match anything after the given URL, so my IF statement will work in each instance?
- How to create/modfiy WP_Query to search in post title OR custom field?
- How to detect custom query inside `posts_where` hook?
- WP query exclude post within the last month / only show over 1 month old
- WordPress query for most recent posts from multiple categories
- Pass array of taxonomy terms to wp_query
- Using apply_filters(‘the_content’, $custom_query->post_content) alters output
- WP_Query Date Query After Minus Hour AND minus minutes
- Get posts for last working week in WP_Query
- Shortcode to show thumbnail and link for 3 random posts
- wp query template tags not working
- How to select events within current week using wp_query
- how to link to detail page(single.php?) in a wp_loop
- How to display upcoming events by dat with Modern Events Calendar Lite
- Meta Query Array Error 500
- How to Filter Posts by Custom Fields?
- Display posts from only one post form in custom query and exclude in main query
- Get pagination working for custom loops within page templates
- Complex WP SQL Query
- pagination with ‘no_found_rows’ => true,
- How to get all product attributes for filters in WooCommerce?
- Fetch Record based on meta key dates
- How can I display list of all posts from a specific author, with publish dates in the future, on an author archive page (author.php)?
- Custom posts visible in admin, but truncate in public
- Query to get siblings and parent page
- Why does get_posts only show results for Admins or logged-out users?
- How to store and receive variables in WP sessions?
- How to list posts with disabled/closed comments, with pagination?
- Add filter post_where and passing post_type argument
- WP_Query infinite Loop
- Limiting number of related posts
- Get Child Page IDs by Parent ID
- how would i change post->ID to work correctly when querying pages?
- WP User Query with Custom Fields and Search Results
- Pagination works in custom query loop but it doesn’t work in shortcode
- Event with multiple dates, display events chronologically
- WP_Query order by not working properly due to category I believe
- Create a notification for post field
- WP_Query to get post on frontpage
- When listing child pages run out of memory
- Function to retrieve IDs of posts, cache results, and improve wp_query
- How to avoid filling up an array each time I run a WP_query?
- How to SQL query posts IDs by categories AND authors?
- Search.php – return number of results but cannot loop through
- Admin: Custom Query Returning Permissions Error
- How to get pages of parent (non-recursive)?
- wp query remove posts from query then update max pages and posts found
- WP_Query Orderby meta_key and hide some meta_key
- Show X taxonomies of the latest published posts
- Combine query in WP_User_Query()
- Combine relationship posts with existing wp_query
- Custom wp_query inside a conditional stament inside a template part doesn’t work: why?
- Slick slider for post doesn’t display anything
- What is the equivalent WP_Query of a SQL Query?
- create custom shortcode wp and put php code in
- WordPress Query custom ordering by temporary variable
- Check the stored / cached WP_Query with transients on post change
- New template file does not load category-specific post
- use mysql variable in a $wpdb->query to reindex a column?
- How to get only present and past posts with post_date
- How to create better WP_Query to look for date time which is anywhere between two meta values?
- Query WP Posts, then list the taxonomies from those posts
- Query post with content only
- Load WP Query with Ajax
- Displaying Pages in Nav Sub-Menu with Specific Taxonomy Terms?
- WPQuery loop not giving expected output
- WordPress tax_query ignoring relation OR
- pagination functions are not working
- Fetch only categorized posts
- Wrap group of wp query posts to parent div by date/year
- Continue loop after $queryObject
- Order Posts By Youtube Views
- Wrote a WP Cron Plugin and it triggers a fatal error upon activation
- Declare inline background image in functions.php
- Get the type of an advanced custom field (ACF) in a WP_Query loop [closed]
- wp_query conditionally get posts
- Getting Year & Date inside wpdb [duplicate]
- loop through custom post types with meta data
- Looking for a way to exclude frontpage and nav menu from query filter
- Using Query In Post Type Archives
- WP Query Obj: Set value to be unequal | Hide media by admin
- the_excerpt() not working in custom archive
- Get posts by meta value except one post [closed]
- Display Featured image from custom post type category (custom taxonomy) wise
- new WP_Query with order args – no more distinction between categories
- How to make OR condition in WP_Query