You can add ID’s to thumbnails like this.
<?php
$attributes = array(
"class" => "main-image portfolio " . $extraLastClass,
"id" => "photo_" . $post->ID,
);
the_post_thumbnail( "large", $attributes );
?>
Notice I have append id
with $post->ID
.
Related Posts:
- Get previously visited page ID
- ID for posts/blogs page
- Get ID of “root-page”
- Get the correct post id for all post and page in header.php
- Get users between user ids
- ID of Front-Page
- Always Encounter Using ID in WordPress as a Final Solution [closed]
- Why does the page/post ID keep growing when i refresh the post-new.php file?
- How can I exclude a specific ID from this line of code?
- get page id’s – not get pages?
- get post by nav id
- Ad units Div-ids frequently changing
- Consequence of the post auto incrementer off?
- Subcategory IDs in relation to parent category ID switch case
- get_pages gives wrong ID for blogpage
- How to get Author ID outside the loop
- How to get page title with the page ID?
- Are post ID’s reliable?
- get all posts ID from a category
- What is an alternative to get_page_by_title()?
- Get page id by title?
- How to add the category ID to admin page
- Post ID At The End Of Permalink URL Effects Performance (Positively)?
- How to get page’s ID if I know the title only?
- Getting the ID of a meta box
- $post->ID displays wrong ID
- How to get any tag ID
- Show ids of displayed media library items
- Showing random content / pictures from earlier posts in a sticky post?
- Get the post_id of a new post
- How can I display a specific user’s first published post?
- Creating a Front-end based User Search
- Does the menu item ID ever change?
- How to get user_id from wordpress database inside ajax function?
- Get comment content by comment ID
- Get author ID with attachment ID
- URL scheme to retrieve tag archive by ID
- Passing the page ID to a login php script
- get menu id using its name
- How to create a link to jump to “Leave a comment” part?
- How can I get an array of all IDs from the current queried object?
- Why ids in urls don’t work but slugs do?
- Can a page_id and a post_id be same?
- Fetch ID’s associated with a custom post type when translated with WPML?
- Get post / page ID from ACF Link field
- How to get category URL with the slug?
- Check if someone recently commented in one of my posts
- How to view WordPress’ default category IDs?
- Transient unique names
- Shortcode for a link and thumbnail
- Why is my Blog Page ID == First Post ID?
- How to add ID attribute to each submenu?
- Is it possible to change post id for an already added menu item in WordPress?
- Get ALL post ID’s export list (Only id’s. Php or sql not important )
- Open post-content in archive page in a Modal box with bootstrap
- Search results posts_orderby and ID
- Get posts by list of post IDs ordered by those IDs?
- How to get post ID with hooks publish_post, new_to_publish, etc
- obtain the author id given the post id
- Do posts, pages and / or custom post type objects have unique ID numbers or can there be multiple objects with the same IDs?
- how would i change post->ID to work correctly when querying pages?
- Set post tags using tag ID
- get term id from term name
- post_type internal ID?
- Custom post type returns bad post ID
- php return username of currently viewed author profile
- WP_Query custom field pass the post id
- How to get selected taxonomy or category ID if using custom walker?
- How do post IDs work in WordPress?
- Widget to show posts in the sidebar basing on its IDs
- Making posts permalinks consistent numbers
- How to get custom image field of specific post id
- Is there a way to show attachment IDs on the attachment info screen?
- How can I query the db to access current post information?
- Display posts from an array of ID’s
- Use Author Ids or Names to echo different output inside loop
- Setting post_id for single.php based on URL without a redirect
- Why is my insert row only inserting the final row from the loop into the database rather than just inserting one
- Give custom page template a custom post ID
- Bookmarking custom template pages which all have the same page ID
- Custom Post Type with Sequence ID
- How to block specific user id in custom login form?
- Reuse old post ID for new post after deleting post
- get_current_user_id() always return 0 in if else statement
- Get post attachment with post id
- Get attachment URL from attachment Link in WordPress
- How to use url formatter with integer
- How can i take all ids from untrash_post action?
- Author Page User id in functions.php for non login user
- Get from the dashboard the ID of the current post being edited
- Store All Post Categories In Array
- Retrieve ONLY mp3s and set a variable for use in a playlist called by single.php template?
- Changing starting number of User ID
- unused post IDs
- get_all_category_ids for bookmark
- Query specific posts from parent by slug rather ID
- WordPress loop: Display if posts exist
- Where to add the code for an outer container in a theme?
- What is $post->ID
- Set a minimal number for next user_id