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?
- 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
- How to add post_type=value when editing that post type in the WordPress admin?
- 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
- Archive for custom taxonomy lists all posts instead of current taxonomy
- Display only one post each WEEK
- List children on child post
- Show custom post type filtered by category
- Stuck in Order by more then one
- Query Multiple Custom Posts by Custom Fields
- Several post types on WP Query by tag and taxonomy
- Polylang non-default language ignores tags in WP_Query
- Prioritize posts in query by meta keys?
- Homepage’s content is dependent on the custom field values (set automatically), how do I get homepage to update without manually updating page?
- 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
- Different Ways to Query Custom Post Types?
- 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
- Reworking function for counting custom post type posts count
- How to make WP_Query not to show irrelevant posts?
- Loop for custom post types filtered by a taxonomy
- Custom post types and ‘new WP_Query’
- Variable not working in WP_Query
- Custom post type, custom taxonomy, query posts only from taxonomy (children of)
- How to Make infinite loop of post
- WP_Query with custom post type ID
- Pagination not working on custom query on a page
- Query within a foreach within a query (queryception)
- find custom post type post by searching its custom field with my string
- wordpress lists similar type of posts in a custom post type
- FacetWP paging custom wp_query
- How to give classname to post if post has no content?
- display posts of custom post type with custom taxonomy
- How to Query in WordPress which shows Alphabetic Posts?
- Can’t change posts per page in WordPress Post Type Query
- postsperpage value not being applied
- 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
- list posts of two post types in a single template
- How to properly use Categories with Custom Post Types
- 4 posts per page from single category
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Custom Post Type Query W/Category Dropdown
- Find Posts based on Child Post value
- Custom Post Type ‘Event’: Chronological list of recurring events from meta_values in array
- Sorting the Loop by Taxonomy Value
- Custom Query: Multiple CPTs and a taxonomy filter
- WP query_posts group by meta field related
- date_query empty results with custom post type
- 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
- Create a post automatically if search result has zero results
- Limiting the Number of User Posts to Their Own Posts
- 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
- Use WP_query to match post types based on custom field values
- 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
- Use WP pagination functions on a custom page template
- Query posts based on user preferences
- Custom post Query and WordPress Post Query Clash
- 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
- Why get_posts() returns empty array while I am trying to get posts from some specific taxonomies and work properly with others?
- Most efficient way of showing children posts?
- How can you use a page for a custom post type?
- Only show current category post
- Main site single-property.php design, as homepage of a multisite
- How to set class to “current-page” on the currently viewed single post within a CPT
- Imported Content Doesnt Show Up On Frontend
- How To Loop Through list with Custom Post Types
- This wp_query will not return any posts and only seems to work with post_status inherit?
- 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