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 :before
/: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!
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.