I am trying to copy data from a custom field named ‘schema’ into my header. I have used the following code and I can see it in my header but it is not executing and I can’t see why. Can anyone please tell me what I’m doing wrong?
<?php
$schema = get_field(‘schema’);
if ($schema) {
echo $schema;
} else {
echo ’empty’;
}
?>
Fixed. Rookie mistake, I was putting the code straight in the header and not in functions.php.