Skip Navigation

[Resolved] Adding full size image link to image field within post

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 7 years, 2 months ago.

Assisted by: Beda.

Author
Posts
#556541
2017-08-04 (2).png
2017-08-04.png

I have added 3 image fields to a custom post type. They show as a row of images within the post layout. I want to add a link to each of the photos so that they can be clicked on and the full size image is shown. As people will be adding them through a post form this needs to work automatically for each post.

#556815

What you want to achieve is done with HTML, and that is a required knowledge set to use Toolset - as it does not provide HTML, CSS or JS codes.

What you will do is wrap a link around your current Image, linking to the full-size image.

I assume you want the Full Image Size shown as a Pop-Up and not on a new page, right?

If so, you need to follow these instructions for customizing your HTML and Theme, as this is not something Toolset helps you with.
https://toolset.com/forums/topic/image-repeater-image-fields-popup/#post-405731
https://toolset.com/forums/topic/lightbox-for-real-estate-reference-site/
(Add Thickbox Support to Theme)

The Toolset will help you to dynamically query and display the content, but to style and format, is up to the developer of the website.

With the Thickbox enabled you can then call a particular Image Size on click of the smaller Image.

Example:

      
<a class="thickbox" rel="gallery" href='[types field="image" raw="true" link="false"][/types]'>[types field="images" link="false" size="thumbnail"][/types]</a>
#557363

That's not quite it - Each image is on a post type (image) on its own with the image, the photographer and other details displayed. I need the link on the image in the gallery to go to the post that the image belongs to.

#557578

I see.

But it confuses me.

In your Code and statement you say, the Images all belong to a Post.
Hence, if you link to the post... you would just link back to the same post again.

Anyway, you can use whatever Link you want in your Custom HTML that you wrap around the actual image.

Let me give an example below.

1. Links to the current Post:

<a href='[wpv-post-url]'>[types field="images" link="false" size="thumbnail"][/types]</a>

2. Links to a specific Post (post with ID 3):

<a href='[wpv-post-url id="3"]'>[types field="images" link="false" size="thumbnail"][/types]</a>

3. Links to the Parent of the current Post:

<a href='[wpv-post-url id="$toolset-parent"]'>[types field="images" link="false" size="thumbnail"][/types]</a>

Note that $toolset-parent here is equivalent to the Parent Post type slug, in case you have such a setup.

You can basically wrap any HTML link around your Image ShortCode.

The forum ‘Types Community Support’ is closed to new topics and replies.

This ticket is now closed. If you're a Toolset client and need related help, please open a new support ticket.