<a rel="lightbox" href="https://wordpress.stackexchange.com/questions/10191/<?php $image_id = get_post_thumbnail_id();
$image_url = wp_get_attachment_image_src($image_id,"large', true);
echo $image_url[0]; ?>">
<?php the_post_thumbnail('thumbnail'); ?>
</a>
Yeah the above (posted by @null) is correct on getting the url, here it is all put together. Including the rel=lightbox. I call to WP’s large image size here personally for the lightbox image to be linked to.
the_post_thumbnail
wp_get_attachment_image_src
Related Posts:
- How to insert multiple images into a single post within a CPT
- Custom Post Type with image gallery
- Not Able to Get Custom Post Type Gallery Images URL
- How to add multiple images to a custom post type without plugin [closed]
- Getting Un Wanted Gallery Shortcode In The Page on Loop
- Not Able to Add New Class To CPT Attachment Image
- Links Image in “Catalog” Page to Posts
- How can I detect a chosen Isotope layout option from within Javascript to generate appropriate layout?
- Change permalinks for posts but not for custom post types
- Assign single template to multiple custom post types?
- How to build a complex page structure
- List most recent image uploads, but only for specific custom post type
- How to add a CSS class to every image in a Custom Post Type
- How to set a fall back template for a custom post type in a plugin?
- How can I fix those issues generated by the Themecheck plugin
- Why is get_post_format() for “Standard” returns empty
- Password-protect a custom rss feed
- How to make a page template to list all galleries?
- Rename a current used post type
- How do I get gallery thumbnail URL and change the default thumbnail size?
- Template tags to display custom post type posts in category template?
- single-type.php not working, delivering 404
- Uploaded image not appearing in custom post type
- Return Attachments from Custom Post Type
- adding .current* tags to custom post types and taxonomies
- Page as a child of a Custom Post Type
- Change post featured image on hover
- List all images from a single post meta value
- Custom Image Thumbnails of Different Sizes
- How to move image thumbnails into custom folder for custom post type
- Hide editor while keeping add media button in custom post type
- How can i add thumbnails images to particular post (using code not admin pannel) in wordpress
- Help need making decision. Ads rotating site on wordpress
- custom taxonamy and post type
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- Add custom image size for custom post type or taxonomy
- How to automatically set ‘default image size’ for specific Custom Post Type
- Display a grid of taxonomy terms at root taxonomy page
- How to create a gallery page with categories?
- Problem: wp_query outputs all images on site
- Building a Treatments Page, What Do I Use?
- Adding custom image sizes and post types to a plugin or to a theme?
- Can anyone help me with galleries and post types?
- Warning: Invalid argument supplied for foreach() [closed]
- Gallery thumbnails very small
- Custom post type isn’t working
- Creating my own portfolio custom-type
- How to show a manageable list of images on a post?
- Two column layout with alphabetical ordering
- Api rest_route 404 while building filter for custom posts (filtered by multiple meta keys / custom fields)
- how to get this tax_query working?
- How do you output an unknown number of images in a custom post type with desired markup?
- Custom post type’s posts are not showing anywere but in xml sitemap
- How to Use Custom Meta Field Instead of CPT Title in Post URL
- Assign a template to a custom post type when displayed by the main loop on the home page
- If Post type use sidebar (‘tree’)
- Using Image Sizes for Custom Post Types outside the Loop
- link featured image to external link
- Having Issue on Getting Metabox Checkbox Value
- Custom meta box in custom post type not working
- Thumbnails Not Generating
- Custom post type posts wont show in wp_nav_menu()
- How can I tell if I’m on a custom post type archive page?
- Front end create custom post types
- How to Enable Ascending or Descending In WordPress Default Built-in Loop
- How to display posts from a certain category in a bootstrap 5 carousel loop with multiple items?
- How to get the custom post data using post id in WordPress?
- Loop all post on single.php
- How can I make reusable post types with complex custom field structures?
- Custom post type 404 category page
- How to search through all child taxonomies using WP_Query?
- Feature image Gallery made from Custom Post type + Categories
- programmatically generated custom post type is created more than once
- How to use posts as tabs in a custom page?
- Custom Post Taxonomy Template Not Loading Properly
- Problem with multi checkboxes value in metabox?
- Change picture attachment meta of all occurrences of a picture
- Create dynamic logo carousel without using any plugin
- Integrate video and iframe in a post type gallery
- call a function when insert and update a custom post type
- How To Display Category list from Portfolio post type plugin?
- Edit is changing my custom’s post type parent id
- How do I set a specific size for my image?
- Working with gallery shortcode and get gallery images
- Search form to find custom meta box generated data
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- How to Display CPT Posts on index Page
- Query custom post type and showing its content
- Issue on Counting CPT’s Under Taxonomy Term
- Image paths on custom post types getting /post_type/ added to path
- Why is my custom form saving with ‘autodraft’ as title and slug?
- Author profile comments system
- Custom post type and custom taxonomy archive inaccessible
- Apply custom names for generic custom taxonomy name?
- Allow authors to create article image
- Category names on CPT archive pages [closed]
- How to create custom page templates with default page layout framework?
- Get images only from a certain post type
- Can you programme the selected page template to display block patterns automatically?
- How to Create Grey Background for Product Images on Website Display but Retain White Background on Downloaded JPGs?