Skip Navigation

[Gelöst] Clickable Div in a Loop item Template

Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.

Problem: I would like to make an entire div element clickable.

Solution: Wrap the entire element in an "a" tag, and remove any nested "a" tags.

This support ticket is created vor 6 Jahre, 6 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by jorg-andreasK vor 6 Jahre, 6 Monate.

Assisted by: Christian Cox.

Author
Artikel
#580138

Hi there

I already got help from the support for creating a clickable div in the Loop Output Editor, works fine.

Unfortunatly it seems to work different in the Loop item template for a different usage, am I right?

To be exact, what is the correct syntax for the following code to make the "postitem_wrapper_bl" Div clickable in a loop template of a view?

<div class="postitem_wrapper_bl">
<div class="innen_wrapper_links_bl">
<a href="[wpv-post-url]">[wpv-post-featured-image size="custom" width="250" height="141" crop="true"]</a>
</div>
<div class="innen_wrapper_rechts_bl">
<div class="zweite_ueberschrift_bl">[types field='zweiteueberschrift'][/types] </div>
<h2 class="h2class_bl">[wpv-post-link]</h2>
<span class="beitragsaufmacher_bl">[types field='beitragsaufmacher'][/types]</span>
</div>
</div>

Can you help, tried so many things on my own, but could not solve the problem on my own?

All the best from Germany

Jörg

#580345

I think you need to wrap the entire div.postitem_wrapper_bl in an a tag, and remove the inner a tag that you currently have in place. Nested a tags are not permitted in HTML.

<a href="[wpv-post-url]">
<div class="postitem_wrapper_bl">
<div class="innen_wrapper_links_bl">
[wpv-post-featured-image size="custom" width="250" height="141" crop="true"]
</div>
<div class="innen_wrapper_rechts_bl">
<div class="zweite_ueberschrift_bl">[types field='zweiteueberschrift'][/types] </div>
<h2 class="h2class_bl">[wpv-post-link]</h2>
<span class="beitragsaufmacher_bl">[types field='beitragsaufmacher'][/types]</span>
</div>
</div>
</a>
#580471

Hi Chris,...

Thx again for your soon and competent reply. It works.

As I mentioned earlier, you are my "Support KING".

Thx and all the best from Germany

Jörg

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