The layout is a matter for CSS. It looks like this is supposed to be a list of some kind, so mark it up as such with HTML:
<!– Begin Custom Fields –>
<ul class="amenities">
<?php if ( get_field(‘kitchen’ ) ) : ?>
<li><?php the_field(‘kitchen’); ?></li>
<?php endif; ?>
<?php if ( get_field(‘air_conditioning’ ) ) : ?>
<li><?php the_field(‘air_conditioning’); ?></li>
<?php endif; ?>
<?php if ( get_field(‘dishwasher’ ) ) : ?>
<li><?php the_field(‘dishwasher’); ?></li>
<?php endif; ?>
…
…
<?php if ( get_field(‘handicap_friendly’ ) ) : ?>
<li><?php the_field(‘handicap_friendly’); ?></li>
<?php endif; ?>
</ul>
<!– /End Custom Fields –>
… and then use CSS to lay it out the way you like. For a list displayed in multiple columns you can use the columns CSS module.
Could you show the template code you are using? Sounds like the text is hard-coded somehow. Here is the documentation about the page link field, and how the text is generated.
Please note, however, that it is generally bad practice to have link text read something along the lines of “click here”; you should have more descriptive link text. See https://www.w3.org/QA/Tips/noClickHere or http://stephanieleary.com/2015/05/why-click-here-is-a-terrible-link-and-what-to-write-instead/ or https://jimthatcher.com/news-061607.htm or https://www.smashingmagazine.com/2012/06/links-should-never-say-click-here/.
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.
Wow, thank you so much, that’s exactly what I needed. I didn’t even know this existed, I’d probably never have found it myself. 🙂
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.