You can check current_post
in the loop. Just remember it’s zero-indexed, so first is 0, second is 1, etc.:
if( 0 == $employee->current_post ):
// this is the first post
else:
// this is > first post
endif;
Related Posts:
- Newer/Older posts links display same posts on every page
- List events by month
- How do I write this SQL statement for Posts written in last 24 hours?
- How to show related posts by category or custom post type?
- How to create posts (not post template) to be displayed on projects page?
- IF statement in a do_shortcode
- Why does using WP_Query inside a shortcode in an elementor page cause the arguments for WP_Query to get malformed?
- get_template_part for custom post type content not working
- Loop on front-page.php
- How to get all posts except for one post from a certain custom post type?
- Remove duplicated values from a loop
- How i can add ‘N’ page of ‘N’ pages under posts loop?
- I would like to have different styles for my posts based on the content of each post
- List custom taxonomy specific to one custom post type
- Shortcode not working with post counter
- The loop seems stuck to a single (now deleted) post
- Conditional for a Single Post That Belongs to a Category?
- Custom post type showing same Post on all Pages
- Post loop count is not in order
- How to Make infinite loop of post
- WP_Query with custom post type ID
- Batch Extract Date from post title and put into ACF custom field
- display posts of custom post type with custom taxonomy
- get custom post type value in header.php [closed]
- Get post format
- Custom wordpress loop
- displaying content of custom post type
- Posts are not rendering perfectly [closed]
- Display post from custom post type
- Use post in multiple places on a page with multiple posts
- Custom Sidebar in Editor (not Widget) for Custom Post Type in Genesis
- The loop does not show users
- How to fetch posts that are stored in the different table than (default) wp_posts?
- If/Else child list for Custom Post Type single template within loop?
- Fetch data from two custom post types and create multidimensional array for output to html table
- How to display posts with plugin (advanced custom fields) field groups?
- WordPress – display relationship between blog posts and custom posts
- Show custom post type event if current day using ACF
- SEARCH QUERIES – REVERSE OUTPUT
- Some posts not displaying by taxonomy term
- ACF meta_key and meta_value break loop
- Adding specific custom fields (images) to post excerpt
- Wrapping an unknown amount of posts inside separate HTML Containers during WP_Query loop
- How can I group by Taxonomy on Custom Post Type while filtering out based on custom Meta
- subtracting the current post form then whole loop, which is generating all CPT titles
- Display title of all custom posts from same taxonomy term on a custom post template
- Custom post Query and WordPress Post Query Clash
- Display related post content and custom field content
- Only show current category post
- How To Loop Through list with Custom Post Types
- $post breaking container loop
- How to create content automatically when a post is published?
- If i have custom post type with 5 custom fields do i have to create a new loop to reference each one?
- Turn post into simple slideshow
- Pulling in a particular post into a single page based on the post id passed into the code
- Custom Post Type Loop breaking php
- the_content() stop images being pulled through
- Filter page ID outside the loop and order
- WordPress post objects in one parent post object
- Retrieve a specific field from taxonomy term through advanced custom fields [closed]
- Query Custom Post by Category
- ‘category__and’ for custom taxonomy?
- WP_Query and using a variable for ‘cat’=> in the args array = WP Bug?
- count_many_users_posts except current logged in user?
- Checking if Post Title is Unique as Loop Criteria
- Custom post type, organized by categories
- Side effects of Script and Iframe in post
- A custom post within a custom post
- get_the_title() is returning results from previous loop
- wordpress remove views from action links in a custom post
- 3 random images from custom post type, each in a div with a diffrent class
- Displaying multiple post types on home page
- Shortcode leaves no space for other elements?
- Query to get child pages of current page and display it in action hook
- Send post changes to set email addresses (not users or subscribers)
- Limit search field to just search a custom post type with custom fields
- Custom post type title of each author in his own post
- Permalinks for single-[custom-post-types] not working
- Show posts associated with ACF post object and custom post type
- Custom Posttype URL
- open custom post type in popup window instead of page
- WordPress next post by ajax call on button click
- Pagination for a cpt filtered with a category
- filter using custom fields
- How to manage a dynamic multi-level page hierearchy system?
- custum post inner page not taking single-gallery.php? it redirecting to archive page
- Change Custom Post Type to Post + Category
- Fixed custom fields depending on posttype/category
- Strange behavior on WP_query
- Grouping and paging CPT events by month with custom field date
- How to check if meta box value is false for all posts then do something based on that
- Cannot use pages created on WP
- Tricky Custom post loop
- display news with pictures 3 small and one large (loop)
- Custom Post Type post not appearing
- Display multiple custom post type lists on homepage – multiple loops
- why get_post_meta is returning 0?
- using a template for more then 1 page
- Get post from custom post type that title is like custom string [closed]
- Get all active posts that are tied to a custom taxonomy for a custom post type