function is_first() {
global $post;
$loop = get_posts( 'numberposts=1&order=ASC' );
$first = $loop[0]->ID;
return ( $post->ID == $first ) ? true : false;
}
you can use this too
Related Posts:
- How to get post content by calling ajax?
- Get the ID of the latest post
- Retrieving 3 latest post from each of 5 different custom post types
- Get latest 3 posts from multiple CPT in one query
- minimize wp_query call to database
- Get post from Category by Priority
- Query Posts From Multiple Post Types
- How do I correctly query posts from a post ID?
- How to show all posts of the category in wordpress?
- Display Custom Post Type Fields
- How to hook get_terms() to only show count of posts that have custom meta
- how to group custom post type posts by custom taxonomy terms
- Using Query Posts With Multiple Post Types And A Taxonomy
- How to get the parent’s taxonomy?
- Loading post content in FancyBox
- Wp-query causing problems with the_content();
- Query post types with multiple keys
- ascending order custom post type
- Query not returning CPT posts
- How to get only one category of custom post type?
- Unable to display multiple post types in same query (WPML WP_Query)
- Get all posts WHERE custom_field is LIKE value
- Separate Posts and Custom Post Type in Custom Taxonomy archive template
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- Custom query shows custom post types in trash
- WP_Query is printing out only one post when posts_per_page is set to multiple
- Combine query_posts() and get_posts() into single query
- WordPress Orderby Numeric Value Not Working
- is there a way to retrieve posts that do not have a featured image assigned?
- Shortcode for display posts on home page show only one post
- Sorting multiple custom post types without a meta key/value pair by sort order
- Display custom post type from dynamic custom field
- Query/list all terms and their custom post count
- Storing posts from query and accessing later via AJAX call
- Display only one post each WEEK
- List children on child post
- Stuck in Order by more then one
- Several post types on WP Query by tag and taxonomy
- Polylang non-default language ignores tags in WP_Query
- How to get all tags of a custom post type by id
- Limit the post for differents custom post type in the same wp_query
- pagination not working for category.php (custom post types in categories)
- How to display Related Posts based on number of taxonomy terms matched
- WP the_posts() on single-cars.php get category link
- Different Limit number of post on different archive page
- How to make WP_Query not to show irrelevant posts?
- Custom post types and ‘new WP_Query’
- Variable not working in WP_Query
- Pagination not working on custom query on a page
- Query within a foreach within a query (queryception)
- Can’t change posts per page in WordPress Post Type Query
- Group by custom field value (start and end times)
- How to query Posts from a custom post type which contains a custom taxonomy?
- Display post from custom post type
- List all posts in taxonomy term
- Get posts by category name
- How to properly use Categories with Custom Post Types
- 4 posts per page from single category
- Custom Post Type Query W/Category Dropdown
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- WP query_posts group by meta field related
- Custom wp-query display post only today
- Get_post_custom not fetching value from array wordpress
- Display Parent-Child Posts in specific order by comparing IDs in array
- custom post type and a “sticky” position taxonomy
- how to display posts content on the custom css popup by clicking on each title on the sidebar?
- Modify default Related Posts Code to Custom Post Type
- wp_post_delete is deleting all offices
- SEARCH QUERIES – REVERSE OUTPUT
- How do I insert a custom post type query after a certain number of recent posts and then resume recent posts?
- Query a custom taxonomy in a function to create an csv file
- subtracting the current post form then whole loop, which is generating all CPT titles
- post type => ‘any’ not applied my custom queries
- Custom Post By Category
- Query posts based on user preferences
- How to get the posts that my following users are liked?
- Query the title of the page to show posts with matching category in the loop
- update a posts of other custom post type
- Most efficient way of showing children posts?
- How can you use a page for a custom post type?
- Main site single-property.php design, as homepage of a multisite
- Imported Content Doesnt Show Up On Frontend
- How To Loop Through list with Custom Post Types
- Popup panel is only displaying 1 entry ignoring all others
- Calling specific page with wp query
- WordPress custom post type
- How to get Last post Id of custom post type in wordpress
- display news with pictures 3 small and one large (loop)
- Custom post type blog pagination conflict
- Custom Post Type children and grand-children in one list
- Change display wp post type to wp custom post type
- Dynamically change post_parent in every page load?
- How do I display the index position of a post from a custom post type?
- How to exclude certain portfolios from a loop
- Wp-theme Development
- show the most recent date of all posts to display on front end
- Quering array of post types & pagination. Articles are repeating sometimes on different pages
- Display ACF object field data using Elementor Custom Query
- Sort ACF by custom taxonomy