Return to Snippet

Revision: 60161
at October 24, 2012 10:45 by itsmrchris


Initial Code
<?php $values = get_field('page_title'); ?>
<?php if ($values) { ?>
<h1><?php the_field('page_title'); ?></h1>
<?php } else { ?>
<h1><?php the_title(); ?></h1>
<?php } ?>

Initial URL

                                

Initial Description
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

Initial Title
Wordpress Advanced Custom Field (ACF) - Display field content

Initial Tags
wordpress

Initial Language
PHP