Home › Forums › ACF PRO › Add a class to the last paragraph tag of a wysiwyg field › Reply To: Add a class to the last paragraph tag of a wysiwyg field
Rather than attempt this with ACF, I would do this with CSS. You can wrap the field in a div, like this:
<div class="my-wysiwyg">
<?php the_field('my_wysiwyg');?>
</div>
Then just apply the styling to the last <p> tag with CSS:
.my-wysiwyg p:last-child {
font-size: 30px;
}
Does that help?
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.