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
- Default post showing more than intended
- How to automatically update ACF field value every year?
- button onclick with get_post_permalink
- WP_Query orderby modified to include custom meta changes
- Custom Post Type Loop throws 500 error when used in widget
- Am unable to reset a query properly
- Show the same Article Available in Other Categories
- get_attached_media() on author page not working
- Getting posts under the custom post type ui category
- How to make sure content doesn’t display if selection is empty
- Show one item per category of a custom post type
- Custom fields vs. Custom post types for a Portfolio Website
- Storing posts from query and accessing later via AJAX call
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- If post has custom field then display css-class
- Meta Key Value in current-user-only loop
- How to display all posts from standard posts to custom post types in a loop with pagination?
- Retrieve value of a category’s custom field
- Calculate all custom field values in the post loop
- CPT + CMB2: data not displaying for only first post in loop
- Display only one post each WEEK
- Get next and previous 3 posts in a term in single post page
- List children on child post
- How can I dynamically add a post to a custom post type which uses a custom field?
- Problem with WordPress query on page using custom fields
- Restrict custom post type from appearing with ?post_types=
- the_content() not outputting anything (Advanced Custom Fields)
- Show custom post type filtered by category
- Loop custom taxonomy to get lists of cutom post types?
- create parent post using wp_insert_post
- Turn on and off custom post type from admin?
- Missing Posts in Custom Taxonomy List
- How do i calculate the total of values of custom fields in custom post types?
- Display random posts, but omit the post it is on?
- Multiple Loops On Custom Post Type Template?
- How do I do this with WordPress? Taxonomies?
- Custom loop with multiple taxonomy queries
- Disable block with taxonomies at post page
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Checking if Post Title is Unique as Loop Criteria
- Custom post type not displaying content from single-{custom post type} page