• When you paste into your functions.php file the code

     add_filter( 'acf_archive_post_types', 'change_acf_archive_cpt' );
        function change_acf_archive_cpt( $cpts ) {
            // 'book' and 'movie' are the cpt key.
    
            // Remove cpt
            unset( $cpts['book'] );
    
            // Add cpt
            $cpts['movie'] = Movies Archive;
    
            return $cpts;
        }

    It returns an “unexpected string” error on Archive.

    • This topic was modified 4 years, 1 month ago by Phil Emery.
  • The topic ‘BUG: Sample code generates an error’ is closed to new replies.