Hi there,...
I am using a loop, which works fine, with index =1 and index=other functionallity.
It is all used for standard WordPress post types.
The idea is to make each item in the loop clickable, targeting the depending post. I understand, that it has to be done by a div tag. But until now I could not realize it,... due to the correct spelling and usage of the a tag in it.
Here is my loop without anything for the clickable div:
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-item index=1]
<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>
[wpv-item index=other]
<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>
</wpv-loop><!-- wpv-loop-end -->
I guess, I will need to put a a tag into the"doppelspalter_wrapper" div and another into "postitem_wrapper_bl". But how to achieve this in correct usage and spelling?
Thx
Jörg
Okay so if you want to make the entire div.doppelspalter_wrapper clickable, you can do this:
<!-- wpv-loop-start -->
<wpv-loop>
[wpv-item index=1]
<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>
Then you can use CSS to style the text inside the div to remove the default underline and styles, if you'd like. I can help with this if you can show me in a browser.
Hi Chris,...
Thank you very much - it works,....
Again,... You are my KING... 🙂
Jörg