Home › Forums › General Issues › "Read more" in ACF text or wysiwyg field › Reply To: "Read more" in ACF text or wysiwyg field
Actually, I managed to solve this problem in another way. I post here the solution in case somebody else is interested in the answer:
1) I created a Wysiwyg Editor field.
2) Added the field normally in my php file.
3) In the post editor, I used the normal wordpress “more” tag, which automatically inserts the shortcode <!–more–> inside my content and creates two paragraphs automatically, one before and one after the shortcode.
4) In my Jquery file, I wrote this code:
$('p').html(function(_, text) {
return text.replace('<!--more-->', '<a href="#" class="read_more">read more</a>' );
});
That’s it, basically. With that link and that class I can manipulate the link as I want.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.