Hello,
Hmm, yes, I see the issue is that the plugin is trying to get 62 characters or 4 words from the title including the link, <a href="...">
. I’ll fix that in the next update shortly.
To avoid duplicating the 5th post title, could you try something like this?
[loop type="post" count="5"]
[if not every="5"]
<h4 class="news_box">[content field="title-link" length="62"]</h4>
<hr class="news_hr" />
[/if]
[if every="5"]
<h4 class="news_box">[content field="title-link" words="4"]</h4>
<hr class="news_hr" />
[/if]
[/loop]
I’ll test this tomorrow when I have time, to make sure it works.
Hi,
I tried to use the code that you posted above but it only returned 2 posts.
😛
Cheers
Hello, I addressed these two issues in the latest update. Now title-link will be trimmed by word/length before wrapping it in a link. Also [if not every="5"]
should work as intended.
I think I broke it again 😛
[loop type="post" count="5"]
[if every="1"]
<p class="news_box"><a href='[content field="url"]'>some random text</a> <span class="news_date"> - [content field="date" date_format="d/m/Y"]</span>
<hr class="g10-separator-news sep-shadow" />
[/if]
[if every="2"]
<p class="news_box"><a href='[content field="url"]'>some random text 2014</a> <span class="news_date"> - [content field="date" date_format="d/m/Y"]</span>
<hr class="g10-separator-news sep-shadow" />
[/if]
[if every="3"]
<p class="news_box"><a href='[content field="url"]'>Your Guide to Choosing a CTRM Solutions Provider</a> <span class="news_date"> - [content field="date" date_format="d/m/Y"]</span>
<hr class="g10-separator-news sep-shadow" />
[/if]
[if every="4"]
<p class="news_box"><a href='[content field="url"]'>You some random text Now</a> <span class="news_date"> - [content field="date" date_format="d/m/Y"]</span>
<hr class="g10-separator-news sep-shadow" />
[/if]
[if every="5"]
<p class="news_box"><a href='[content field="url"]'>some random text again</a> <span class="news_date"> - [content field="date" date_format="d/m/Y"]</span>
<hr class="g10-separator-news sep-shadow" />
[/if]
[/loop]
This repeats the 1st if statement after every item of the loop 🙁
Thanks again
Heheh, I see you’re really pushing the limits of the plugin!
[if every="1"]
will display for each post, but you can try [if first]
. There’s also [if last]
.
For your use case, perhaps there should be a count parameter: [if count="1"]
. I’ll make a note of it of a future update.
hehe
It is not me it is the content editor 😀
I’ll give it a shot.
Thank you very much.
🙂