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 7 Jahren, 1 Monat. 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.

Heute stehen keine Supporter zur Arbeit im Werkzeugsatz-Forum zur Verfügung. Sie können gern Tickets erstellen, die wir bearbeiten werden, sobald wir online sind. Vielen Dank für Ihr Verständnis.

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)

Dieses Thema enthält 2 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von jorg-andreasK vor 7 Jahren, 1 Monat.

Assistiert von: 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">
[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>

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