Home › Forums › General Issues › "Read more" in ACF text or wysiwyg field › Reply To: "Read more" in ACF text or wysiwyg field
A non-JS option:
Just swap out ‘company_detail’ for the name of your WYSIWYG field.
And set/alter the length of the excerpt by changing the ’32’
<p>
<?php
$raw_content = get_field( 'company_detail' );
$trimmed_content = wp_trim_words( $raw_content, '32' );
$clean_excerpt = apply_filters( 'the_excerpt', $trimmed_content );
echo esc_attr( $clean_excerpt );
?>
</p>
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.