Support

Account

Home Forums ACF PRO Before Pseudo Elements

Helping

Before Pseudo Elements

  • Hey guys,

    I use ACF Pro and I must get the image url from my custom field to the :before pseudo-element of my diferent divs.

    Is this possible?

  • You need to get the value of your field and create CSS for it.

    
    <style>
      #my-element:before {
        background-image: url(<?php the_field('image-field-name-that-returns-url'); ?>);
      }
    </style>
    
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Before Pseudo Elements’ is closed to new replies.