Home › Forums › Front-end Issues › How to Apply Custom Field Content to Styles? › Reply To: How to Apply Custom Field Content to Styles?
There are different ways to create custom bullet points, either with the
list-style-image CSS property or with a background image or with generated content (CSS pseudo-elements
:after, and then a background on those).
The best practice would be an internal stylesheet in the document header (similar to what John Huebner suggested), i. e. in header.php, and then add a class to the list (or an ancestor) in question to apply this style to that element.
Another way would be inline-styles on the list items themselves, like:
<li style="background-image: url("<?php the_field('bullet_image'); ?>">item text</li>
But the first method would be preferable as it is more flexible in the end.
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!
❓Ever wondered when and why ACF uses JSON instead of the database? Check out our summary of the most recent session of ACF Chat Friday for the answer, and make sure to register for the next session.— Advanced Custom Fields (@wp_acf) February 23, 2023
© 2023 Advanced Custom Fields.