I forgot to show you the code I use to display the field:
<?php $colore = get_field(‘colore’);
if( $colore ): ?>
<?php foreach( $colore as $colore ): ?>
<span class=”color-<?php echo $colore; ?>”></span>
<?php endforeach; ?>
<?php endif; ?>
Hi Keith,
thank you, I’m going to test…
Hi Keith,
thank you very much, but I’m a disaster with PHP…
I hope you can help me with patience!
I have created an URL field (slug collegamento) and I see that when I edit a post it is displayed in the back end.
Inside this URL field I have to insert manually the URL.
Is there a way if I select the paese CHIUSI (SI) to get the link automatically?
Pietro
Hi Keith,
thank you very much for your reply.
Basically, I haven’t understood which solution you suggest.
I mean, text field or checkbox…?
My idea was to use a select field with a dropdown list of locations to choose.
It is ok that I can choose only one location per post.
I have already created a select field and I display it on the front end with this code:
<?php if( get_field(‘paese’, $this->post->ID) ): ?>
<div class=”block-left”><?php the_field(‘paese’, $this->post->ID); ?></div>
<?php endif; ?>
Next step is how can I do to link each location to a page (for example, I could link CHIUSI (SI) to https://paesechevai.com/chiusi
Please help…;-)
Thank you,
Pietro