Support

Account

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?