/ Published in: PHP
In this example it checks to see if the page it is on has an ACF named page_title, if so - display it as an H1, and if not, display the WP default page title as the H1
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php $values = get_field('page_title'); ?> <?php if ($values) { ?> <h1><?php the_field('page_title'); ?></h1> <?php } else { ?> <h1><?php the_title(); ?></h1> <?php } ?>