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?
- How to have the right design for a custom post type without accessing themes
- Dynamic Custom Post Type Plugin
- Display custom field of specific post where post title matches variable
- Custom Post Type | Fatal Error on register_post_type()
- Set object terms not working on plugin activation
- 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
- If post has custom field then display css-class
- How to customize a permalink (URL) structure?
- CPT + CMB2: data not displaying for only first post in loop
- Adding a custom post type taxonomy template in plugin
- Replace text in post from cvs
- 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
- Custom Tag Description unable to display just below and outside of the Loop
- 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]
- Make a custom_post translatable
- Problems wp_insert_post and save_posts filter
- Custom fields for custom post type
- 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
- Loop increase number
- Using wp_query to modify the loop in index.php for a CPT
- ACF in wordpress
- post_parent in custom post type
- Control content before and after custom post type loop
- Dynamically insert code to 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”
- How do I add custom HTML to the content of an archive page’s posts?
- 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
- Unable to format dates to put in event calendar
- Filter content in shortcode
- Custom post type in Custom widget – $listItem
- 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?
- Show the categories the current post has
- Custom post type page with parameter
- Fetch data from two custom post types and create multidimensional array for output to html table
- 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?
- i need to make custom cron_schedule with custom interval time as a parameter into a custom payment gateway plugin wordpress
- 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?
- Pagination not working in custom post type. Help
- Plugin Development using classes – Public & Private Callbacks
- Problem with checked box on wp car manager plugin
- 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
- Combine multiple separate lists into one
- Looping to organize and display custom posts by category using PHP and WordPress
- Restrict Custom Post Type to One Item
- Custom Post Type Front Page Gives 404
- 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
- public custom posts not showing in my wordpress plugin
- How to fetch WordPress Gallery Images to a Custom Post Type?
- Remove H1 title in admin post edit screen