Getting the content field to cut off at the more tag

I’m trying to recreate a CCS recipe into TLL but cannot find an answer to my question on this forum.
In my loop recipe I use the tag [content more=“read more”] to get the content up to the ‘more’ tag that is in my page to insert the jump point. I understand that the jump link can be inserted another way but I would like to know how I can generate the content op to my chosen jumping off point.
Is this possible in TLL?

Hi Michel, welcome to the forum!

I did a bit of testing and it seems like this is possible if you use the excerpt field instead of the content field. Assuming you don’t already have an excerpt specified on the post, you can use <Field excerpt auto=true words=500 /> to display an excerpt that gets automatically cut off at WordPress’ more block. Just make sure the words attributes is greater than the number of words before your cutoff, otherwise it’ll cut off at that word count instead of the more block.

If you want a “read more” link, I’d just do that manually with something like <a href="{Field url /}">Read more</a>.

One caveat to this is that L&L (and I think WordPress itself as well in certain contexts) strips HTML tags from excerpts, so if you have multiple paragraphs before your more block, they’ll turn into a single paragraph.

Anyway, I hope this helps!

1 Like