Title: title_tag causing array to string conversion error
Last modified: August 30, 2016

---

# title_tag causing array to string conversion error

 *  [Josh](https://wordpress.org/support/users/jmccallweb/)
 * (@jmccallweb)
 * [10 years, 8 months ago](https://wordpress.org/support/topic/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.

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [alexelash](https://wordpress.org/support/users/alexelash/)
 * (@alexelash)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/title_tag-causing-array-to-string-conversion-error/#post-6431488)
 * Did you find a solution to this issue? I’m seeing the same thing.
 *  Thread Starter [Josh](https://wordpress.org/support/users/jmccallweb/)
 * (@jmccallweb)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/title_tag-causing-array-to-string-conversion-error/#post-6431489)
 * I just changed the $page variable to something more unique, e.g. $my_page. Fixed
   it for me.
 *  [elainevdw](https://wordpress.org/support/users/elainevdw/)
 * (@elainevdw)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/title_tag-causing-array-to-string-conversion-error/#post-6431502)
 * I never would have found that!!! Thanks so much.
 *  [Anthony Keller](https://wordpress.org/support/users/antk3/)
 * (@antk3)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/title_tag-causing-array-to-string-conversion-error/#post-6431513)
 * Thanks Josh, I was wasting time over this. I submitted a bug report to [@elliotcondon](https://wordpress.org/support/users/elliotcondon/)
   on his bug report forum (ACF).
 *  [Elliot Condon](https://wordpress.org/support/users/elliotcondon/)
 * (@elliotcondon)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/title_tag-causing-array-to-string-conversion-error/#post-6431514)
 * Hi guys
 * Thanks for the tag.
    It sounds like using the variable $page is causing issues.
   Please note this can’t be replicated 100% of the time, so there must be something
   else to this story which is causing some function.php files to modify a global
   var instead of a local one.
 * A simple fix is to place your ACF code within an action or function to avoid 
   namespace issues!
 *  [Anthony Keller](https://wordpress.org/support/users/antk3/)
 * (@antk3)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/title_tag-causing-array-to-string-conversion-error/#post-6431515)
 * Thank you [@elliotcondon](https://wordpress.org/support/users/elliotcondon/),
   
   The init action seemed to work, others didn’t, do you see any reason not to do
   it this way?
 *     ```
       if(is_admin()) {
   
         if( function_exists('acf_add_options_page') ) {
   
           function wake_acf_add_options_page(){
   
             $page = acf_add_options_page(array(
               'page_title'  => 'WAKE Réglages',
               'menu_title'  => 'WAKE',
               'menu_slug'   => 'wake-general-settings',
               'capability'  => 'edit_posts',
               'post_id' => 'wko',
             ));
           }
           add_action('init', 'wake_acf_add_options_page');
         }
       }
       ```
   
 *  [bebaps](https://wordpress.org/support/users/bebaps/)
 * (@bebaps)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/title_tag-causing-array-to-string-conversion-error/#post-6431516)
 * try this instead
 *     ```
       // add option pages
       if( function_exists('acf_add_options_page') ) {
           acf_add_options_page('Options Page');
       }
       ```
   
 * in your example your are using `$page` which may be the cause
 *  [matt adams](https://wordpress.org/support/users/factor1/)
 * (@factor1)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/title_tag-causing-array-to-string-conversion-error/#post-6431517)
 * Its the PHP Variable of $page
    [@anton](https://wordpress.org/support/users/anton/)
   Keller, try this:
 *     ```
       if(is_admin()) {
   
         if( function_exists('acf_add_options_page') ) {
   
           function wake_acf_add_options_page(){
   
             $acfpage = acf_add_options_page(array(
               'page_title'  => 'WAKE Réglages',
               'menu_title'  => 'WAKE',
               'menu_slug'   => 'wake-general-settings',
               'capability'  => 'edit_posts',
               'post_id' => 'wko',
             ));
           }
           add_action('init', 'wake_acf_add_options_page');
         }
       }
       ```
   

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘title_tag causing array to string conversion error’ is closed to new 
replies.

## Tags

 * [title tag](https://wordpress.org/support/topic-tag/title-tag/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 8 replies
 * 7 participants
 * Last reply from: [matt adams](https://wordpress.org/support/users/factor1/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/title_tag-causing-array-to-string-conversion-error/#post-6431517)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
