Support

Account

Home Forums General Issues Setting a function as a Default Field Reply To: Setting a function as a Default Field

  • I’m reading between the lines here but I think you mean something like this:

    <?php $custom_title = get_field('custom_title');
    if( ! $custom_title ) { $custom_title = get_the_title(); } ?>
    <h1><?php echo $custom_title; ?></h1>

    So basically we say; if no custom field exists use the post title. It’s not the most detailed of questions but I’m hoping this is a suitable answer and helps you.