I want to add advanced custom fields/custom fields to my header.php as it contains text and phone numbers that we may change – I have tried referencing them but it didn’t work. I have also Googled and not found a solution yet.
I want to be able to edit the content of the fields from my home page, so I am thinking that might be what I am doing wrong?
When I reference the advanced custom fields at the top of my header page in Adobe brackets, the colour of the code doesn’t change so I am guessing it isn’t allowed there.
Would I set something up in functions.php ?
EDIT: Adding code example – I have a few fields to add but obvs just need to get one right. As I mentioned, cannot add ref to ACF in the file as you normally do, it doesn’t work the same.
<div class="pull-right hidden-sm">
<h3>Recruitment: <a href="https://wordpress.stackexchange.com/questions/265077/tel:<?php echo $recruitment_number_ctc; ?>"><?php echo $recruitment; ?></a></h3>
1 Answer
Can you put the following code for displaying content of custom filed?
<?php the_field('filed_name'); ?>