If you just want to target the first item you can define a variable $first_round=true
before you start the loop. Inside the loop, towards the end, you do $first_round=false
. So this variable is only true the first time you go through the loop and you can add
if ($first_round) echo '<div>...</div>'
right after your call to the_post_thumbnail()
.
Related Posts:
- List events by month
- Validate Custom Post Type fields
- Accessing download link from the loop with WP Download Manager Pro
- How to Add Custom Taxonomy To Woocommerce Plugin
- Prevent trash/delete action on specific post types
- How to add custom content template part for a custom post type on main query using a plugin
- register_taxonomy with multiple object type and update_count_callback
- How often do you need to register_post_type?
- How to use a dedicated template for the Custom Post Type from a plugin?
- Include images from pages in wp search.php results in default wp search
- Custom post type loops with different page templates
- Remove POST_TYPE from custom post type permalink
- How to register custom post types in a plugin?
- Row actions not showing? Why?
- How do you output custom code between posts in the loop?
- Display custom field of specific post where post title matches variable
- Custom Post Type | Fatal Error on register_post_type()
- GravityForm: Populate Dropdown with custom post type [closed]
- Create a random unique 6 digit number as custom field for custom post type
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Get rewrite slug of custom post type in template
- Admin notice not displaying
- Can’t get order_by meta_value_num to work properly
- Very Slow Page – How to Optimize # of Queries?
- Custom Post Type Loop throws 500 error when used in widget
- custom post type not showing in menu
- Custom posts don’t work
- How to make sure content doesn’t display if selection is empty
- How to customize a permalink (URL) structure?
- Adding a custom post type taxonomy template in plugin
- How do i calculate the total of values of custom fields in custom post types?
- I would like to have different styles for my posts based on the content of each post
- Checking if Post Title is Unique as Loop Criteria
- Creating a custom post type, adding custom meta fields, preventing all future editability of posts of this type
- Use custom metabox to update automatically a post after a given date
- Addition of custom option panel crashes Media Library & Admin Area
- How to Get WordPress custom post data in WooCommerce product meta panel? [closed]
- Problems wp_insert_post and save_posts filter
- Custom fields for custom post type
- Redirect to another page using contact form 7? [closed]
- Including all post id’s of a custom post type into an array
- How can I group posts by months and years?
- Trying to Create a PHP Variable for post_type that can be referenced Site Wide
- Main query not querying any posts in custom taxonomy template
- Using wp_query to modify the loop in index.php for a CPT
- Control content before and after custom post type loop
- Show current custom taxonomy
- How exclude or skip post type with get_next_post_link
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- Loop in elementor custom widget not working
- How To Post WordPress Custom Post Types to Twitter via IFTTT
- Pagination hitting 404 page on /page/4
- Get data from PHP to JavaScript to set position of each post on front page
- Types plugin custom post add_action hooks
- Accessing a protected property of a post
- foreach loop inside the loop creating duplicates in output
- Compare Two Custom Post Types Using The Same Custom Taxonomy
- how can i show a google map in custom post type
- How can I increase the post count for custom post types only?
- Custom post type page with parameter
- Change Dropdown jQuery to show/hide but with default place holder that shows all
- Page that lists publications by classifying them by taxonomy
- CPT loop doesn’t seem to account for post date?
- How to show the post which checkbox is not selected
- How to get the custom field value using SQL query
- Is it possible to get the specific content on the search page?
- when looping through custom post data not appearing
- Custom Post Type has wrong label and is not found when called by a loop
- Set a template on a custom post in the plugin
- Looping to organize and display custom posts by category using PHP and WordPress
- Restrict Custom Post Type to One Item
- Filter Custom Post Type Posts by Taxonomy
- Show parent category and subcategory once in while loop
- Having issue on Loading Meta Data From CSV to CPT
- Insert custom taxonomy into category query
- % encoded URL giving 404 error in WordPress
- Add active class to foundation 6 tabs while looping categories
- Custom post type that lets users create a set of posts?
- Include images from pages in wp search.php results in default wp search
- Display related post content and custom field content
- WordPress loop add heading before first of type
- Can’t save custom post type fields
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Strange behavior on WP_query
- get_post_meta for Custom Post Type ( CPT )
- WordPress query posts by custom post type not workng
- How to display all custom fields associated with a post type – IN THE ADMIN AREA?
- WP_Query return highest number only
- Show custom taxonomy not in submenu
- Loop carousel slider in wordpress
- How to Fix WordPress 500 Internal server error due to custom post type
- get_post_types doesn’t work in plugin
- WordPress Custom Post Type and sort by Tags
- Posts without featured image using other post’s featured image
- Custom Post Types in plugins?
- Looping taxonomy in taxonomy?
- Query Custom Post Type by Tag
- How do I filter a custom post type loop by a field?
- How to hide home title on pages and posts?
- How to dynamically register custom post type