Skip Navigation

[Gelöst] Clickable Div in a loop template

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

Problem:
How to to create a clickable Div in a Template for the Loop?

Solution:
To put a hyperlink on the overall Div itself and not on the individual content inside the div, the syntax and html would be like below:

<a href="[wpv-post-url]">
<div class="doppelspalter_wrapper">
  <h2 class="dp-zweiteueberschrift">[types field='zweiteueberschrift'][/types]</h2>
  <h2 class="dp_h2">[wpv-post-title]</h2>
  <!-- Hier wird das Artikelbild verlinked --> 
  [wpv-post-featured-image size="custom" width="633" height="356" crop="true"]
  <p class="dp_p">[types field='beitragsaufmacher'][/types]</p>
</div>
</a>
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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 Antworten, has 2 Stimmen.

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

Assisted by: Noman.

Author
Artikel
#579283

Hi there

I can create a clickable Div in a loop output editor,... but for whatever reason I am not able to create a clickable Div in a Template for the Loop.

How can I ad a clickable Div to my "doppelspalter_wrapper" in the following code?

<div class="doppelspalter_wrapper">
	<h2 class="dp-zweiteueberschrift">[types field='zweiteueberschrift'][/types]</h2>
	<h2 class="dp_h2">[wpv-post-title]</h2>
  	<!-- Hier wird das Artikelbild verlinked -->
  	<a href="[wpv-post-url]">[wpv-post-featured-image size="custom" width="633" height="356" crop="true"]</a>
  	<p class="dp_p">[types field='beitragsaufmacher'][/types]</p>
</div>

Is it possible here too?

All the best from Germany

Jörg

#579506

Noman
Supporter

Languages: Englisch (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Jörg,

Thank you for contacting Toolset support. So you would like to put a hyperlink on the overall Div itself and not on the individual content inside the div, is that correct?

If it is the case, then the syntax and html would be like below, please use this one:

<a href="[wpv-post-url]">
<div class="doppelspalter_wrapper">
  <h2 class="dp-zweiteueberschrift">[types field='zweiteueberschrift'][/types]</h2>
  <h2 class="dp_h2">[wpv-post-title]</h2>
  <!-- Hier wird das Artikelbild verlinked --> 
  [wpv-post-featured-image size="custom" width="633" height="356" crop="true"]
  <p class="dp_p">[types field='beitragsaufmacher'][/types]</p>
</div>
</a>

This will make the whole div to behave as a link. Please try it and let me know how it goes. Thank you

#581813

thx Noman,...

well done

Jörg

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