title_tag causing array to string conversion error
-
EDIT: This seems to be an Advanced Custom Fields conflict. Is it possible to move this to that forum? See below.
I’m getting an array to string conversion error that points to these lines in general-template.php
if ( ( $paged >= 2 || $page >= 2 ) && ! is_404() ) {
$title .= ” $sep ” . sprintf( __( ‘Page %s’ ), max( $paged, $page ) );
}The HTML output looks like this: “<b>Notice</b>: Array to string conversion in <b>…\wp-includes\general-template.php</b> on line <b>884</b>
<title>Site Name | Site Description. | Page Array</title>This seems to only happen on the homepage and archive templates. Single posts, pages, 404s, etc. don’t get the error. Any idea what’s going on?
On further investigation, the following ACF function is causing the conflict. If I remove this, no problems.
if( function_exists(‘acf_add_options_page’) ) {
$page = acf_add_options_page(array(
‘page_title’ => ’45th Parallel Settings’,
‘menu_title’ => ’45th Parallel Settings’,
‘menu_slug’ => ‘theme-settings’,
‘capability’ => ‘edit_posts’,
‘redirect’ => false
));}
Apparently, it’s the $page variable conflicting with new WP title-tag.
- The topic ‘title_tag causing array to string conversion error’ is closed to new replies.