Support

Account

Home Forums General Issues Replace Title if ACF field is filled out Reply To: Replace Title if ACF field is filled out

  • Thanks for the reply! I tried that solution but it ended up changing my h1 title as well.

    In case anyone was wondering, I got this working by adding the following code to my functions.php

    add_filter('document_title_parts', 'replace_page_title', 10);
    function replace_page_title($title) {
        if( get_field('meta_title')) {
            $title['title'] = get_field('meta_title');
        }
        return $title;
    }