Raj Kara
asked 10 years ago

Hi, I’m using a gallery post on the site and it scrolls through a number of images – I know how to add description copy to the image so it appears at the bottom – BUT, how do I link the images to certain pages? 
Naturally, the user will come onto the site, see these images scrolling through and want to click to find out more. I see that each image has an attachment page so I tried that route but still no luck. Please can you help.
Cheers

aitolnews aitolnews
replied 10 years ago

what I found helpful was this code. I created I text with this code and when I click on the image (like an advertisement) it open the relevant page. I think that it will work also using the view attachment page button in the media library menu. Let me know if it works.

Raj Kara
replied 10 years ago

Hi – thanks for your reply! I’m not that clued up with code – where do I put this and where do I input the page url I want to link the image to?
Sorry and thanks
Raj

aitolnews aitolnews
replied 10 years ago

upload an image, save its url (it appears in the same window), create a new page, you’ll see the url of the page in this window (dashboard – pages ), then create a text widget (you find it in the widget), change the url of the image and the page with the ones you found before.

Raj Kara
replied 10 years ago

hi aitolnews – I’m not following, when creating a text widget you can choose single sidebar and topbar – I’m not sure what you mean about changing the url of the image and page with the ones found before. Please help!

1 Answers
Kido D
answered 10 years ago

Hi Raj,
Currently there is no option to link images in gallery post to a page, but you can link it to the gallery post itself. To do that, you can open up the content-gallery.php file in themes/dw-fixel folder, find the code below (around line 13):

<div class="carousel-inner">
...
</div>

and change it into this:

<a href="<?php the_permalink(); ?>" data-toggle="modal" data-post-id="<?php the_ID(); ?>" class="info">
<div class="carousel-inner">
...
</div>
</a>

Hope this helps!

Powered by DW Question & Answer Pro