-
AuthorPosts
-
September 10, 2016 at 10:42 pm #684596
Here’s what’s going on:
I’m the webmaster for our local Rotary who sponsors a 5k. I’m a PHP developer by trade and, but I’m by no means a WordPress ninja.
Recently, an automatic upgrade was done to our server which made certain parts of our antiquated Enfold theme obsolete. I purchased a new theme and installed the “theme only” content into the “themes” directory.
Immediately, I saw a big difference in terms of the front page as the rotating carousel is now back so we’re cooking with grease. However, I still have these errors and I don’t know what they mean or how to fix them. They’re all coming from the header.php file in the child directory.
Warning: strpos() expects parameter 1 to be string, array given in /home4/grey5k/public_html/wp-content/themes/greyghost5k_child/header.php on line 165
Warning: strpos() expects parameter 1 to be string, array given in /home4/grey5k/public_html/wp-content/themes/greyghost5k_child/header.php on line 287
Warning: strpos() expects parameter 1 to be string, array given in /home4/grey5k/public_html/wp-content/themes/greyghost5k_child/header.php on line 301
I’ve got the code for the header.php below. Any idea as to what these errors are and how to fix them?
<?php global $avia_config; $style = $avia_config['box_class']; $responsive = avia_get_option('responsive_layout','responsive'); $blank = isset($avia_config['template']) ? $avia_config['template'] : ""; $headerS = !$blank ? avia_header_setting() : ""; $headerMenu = $responsive ? avia_get_option('header_menu','mobile_drop_down') : ""; ?> <!DOCTYPE html> <html <?php language_attributes(); ?> class="<?php echo " html_$style ".$responsive." ".$headerS;?> "> <head> <meta charset="<?php bloginfo( 'charset' ); ?>" /> <?php /* * outputs a rel=follow or nofollow tag to circumvent google duplicate content for archives * located in framework/php/function-set-avia-frontend.php */ if (function_exists('avia_set_follow')) { echo avia_set_follow(); } /* * outputs a favicon if defined */ if (function_exists('avia_favicon')) { echo avia_favicon(avia_get_option('favicon')); } ?> <!-- page title, displayed in your browser bar --> <title><?php if(function_exists('avia_set_title_tag')) { echo avia_set_title_tag(); } ?></title> <!-- add feeds, pingback and stuff--> <link rel="profile" href="http://gmpg.org/xfn/11" /> <link rel="alternate" type="application/rss+xml" title="<?php echo get_bloginfo('name'); ?> RSS2 Feed" href="<?php avia_option('feedburner',get_bloginfo('rss2_url')); ?>" /> <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" /> <!-- mobile setting --> <?php if( strpos($responsive, 'responsive') !== false ) echo '<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">'; ?> <?php /* Always have wp_head() just before the closing </head> * tag of your theme, or you will break many plugins, which * generally use this hook to add elements to <head> such * as styles, scripts, and meta tags. */ wp_head(); ?> </head> <body id="top" <?php body_class($style." ".$avia_config['font_stack']." ".$blank); ?>> <div id='wrap_all'> <?php if(!$blank){ ?> <div id='header' class=' header_color <?php avia_is_dark_bg('header_color'); echo " ".$headerMenu; ?>'> <?php $social_args = array('outside'=>'ul', 'inside'=>'li', 'append' => ''); //subheader, only display when the user chooses a social header if(strpos($headerS,'social_header') !== false) { ?> <div id='header_meta' class='container_wrap container_wrap_meta'> <div class='container'> <?php /* * display the themes social media icons, defined in the wordpress backend * the avia_social_media_icons function is located in includes/helper-social-media-php */ if(strpos($headerS,'bottom_nav_header') === false) avia_social_media_icons($social_args); //display the small submenu echo "<div class='sub_menu'>"; $args = array('theme_location'=>'avia2', 'fallback_cb' => '', 'container'=>'', 'echo' =>false); $nav = wp_nav_menu($args); echo $nav; $phone = avia_get_option('phone'); $phone_class = !empty($nav) ? "with_nav" : ""; if($phone) echo "<div class='phone-info {$phone_class}'><span>{$phone}</span></div>"; /* * Hook that can be used for plugins and theme extensions (currently: the wpml language selector) */ do_action('avia_meta_header'); echo "</div>"; ?> </div> </div> <?php } ?> <div id='header_main' class='container_wrap container_wrap_logo'> <?php /* * Hook that can be used for plugins and theme extensions (currently: the woocommerce shopping cart) */ do_action('ava_main_header'); ?> <div class='container'> <?php /* * display the theme logo by checking if the default logo was overwritten in the backend. * the function is located at framework/php/function-set-avia-frontend-functions.php in case you need to edit the output */ echo avia_logo(AVIA_BASE_URL.'images/layout/logo.png', false, 'strong'); if(strpos($headerS,'social_header') !== false && strpos($headerS,'bottom_nav_header') !== false) avia_social_media_icons($social_args); /* * display the main navigation menu * modify the output in your wordpress admin backend at appearance->menus */ $extraOpen = $extraClose = ""; if(strpos($headerS,'bottom_nav_header') !== false){ $extraClose = "</div></div><div id='header_main_alternate' class='container_wrap'><div class='container'>"; } echo $extraClose; echo "<div class='main_menu' data-selectname='".__('Select a page','avia_framework')."'>"; $args = array('theme_location'=>'avia', 'fallback_cb' => 'avia_fallback_menu', 'walker' => new avia_responsive_mega_menu()); wp_nav_menu($args); echo "</div>"; /* * Hook that can be used for plugins and theme extensions */ do_action('ava_after_main_menu'); ?> <!-- end container--> </div> <span class="anniversary">8<span class="sub">th</span> Annual</span> <span class="dates">October 1, 2016</span> <a href="https://greyghost.itsyourrace.com/register/" target="_blank" class="registerButton"><!-- <img src="images/pm12/stopwatch.png" /> --> Register Now</a> </div> <!-- end container_wrap--> </div> <div class='header_bg'></div> <!-- end header --> </div> <?php } //end blank check ?> <div id='main'>
September 10, 2016 at 10:45 pm #684597The URL for the site, by the way, is http://greyghost5k.com
September 11, 2016 at 12:18 am #684614Hi,
Thank you for reaching out to us.
Please use pastebin.com to share code.
A plugin conflict may be one of the reason for this issue.
To find which plugin is causing the conflict please follow these steps:1. Go to your plugins page > Deactivate all active Plugins
2. Update WordPress and Enfold to latest version if you have not.
3. Make sure all the plugins are updated.
4. If the problem does not persist when plugins are turned off, activate one plugin at a time and refresh until you find the plugin in conflict.We await the results of your plugin compatibility test.
Thanks for your cooperation :)
Best regards,
VinaySeptember 11, 2016 at 12:49 am #684633Hey, Vinay!
Thanks for getting back with me. I deactivated all of the plugins and it didn’t make any difference.
I think the problem my be revealed in the context of the var_dump that I did based on the PHP error. I’m thinking it starts to cough and sputter any time it gets to a variable for which there is no variable. Look at the array and tell me if anything looks suspicious to you:
array(30) { ["header_position"]=> string(10) "header_top" ["header_layout"]=> string(20) "logo_left menu_right" ["header_size"]=> string(5) "large" ["header_custom_size"]=> string(0) "" ["header_sticky"]=> string(13) "header_sticky" ["header_shrinking"]=> string(16) "header_shrinking" ["header_title_bar"]=> string(16) "hidden_title_bar" ["header_social"]=> string(36) "icon_active_left extra_header_active" ["header_unstick_top"]=> string(0) "" ["header_secondary_menu"]=> string(35) "secondary_right extra_header_active" ["header_stretch"]=> string(0) "" ["header_phone_active"]=> string(0) "" ["header_replacement_logo"]=> string(0) "" ["header_replacement_menu"]=> string(0) "" ["header_mobile_behavior"]=> string(0) "" ["header_searchicon"]=> string(26) "header_searchicon_disabled" ["header_mobile_activation"]=> string(17) "mobile_menu_phone" ["phone"]=> string(0) "" ["sidebarmenu_sticky"]=> string(18) "conditional_sticky" ["layout_align_content"]=> string(20) "content_align_center" ["sidebarmenu_widgets"]=> string(0) "" ["sidebarmenu_social"]=> string(8) "disabled" ["header_menu_border"]=> string(0) "" ["header_style"]=> string(0) "" ["blog_global_style"]=> string(0) "" ["header_scroll_offset"]=> int(116) ["header_transparency"]=> string(0) "" ["header_class"]=> string(188) " av_header_top av_logo_left av_menu_right av_large av_header_sticky av_header_shrinking av_mobile_menu_phone av_header_searchicon_disabled av_bottom_nav_disabled av_header_border_disabled" ["header_topbar"]=> string(20) "header_topbar_active" ["bottom_menu"]=> bool(false) }
You see what I mean? Header custom size. Where is that? Header unstick top. That’s empty. Where do populate that info? There are a few of them. Do you recognize any of the strings that have a zero value and can you tell me how to get this filled in?
September 11, 2016 at 12:49 am #684634This one is easier to read:
array(30) {
[“header_position”]=> string(10) “header_top”
[“header_layout”]=> string(20) “logo_left menu_right”
[“header_size”]=> string(5) “large”
[“header_custom_size”]=> string(0) “”
[“header_sticky”]=> string(13) “header_sticky”
[“header_shrinking”]=> string(16) “header_shrinking”
[“header_title_bar”]=> string(16) “hidden_title_bar”
[“header_social”]=> string(36) “icon_active_left extra_header_active”
[“header_unstick_top”]=> string(0) “”
[“header_secondary_menu”]=> string(35) “secondary_right extra_header_active”
[“header_stretch”]=> string(0) “”
[“header_phone_active”]=> string(0) “”
[“header_replacement_logo”]=> string(0) “”
[“header_replacement_menu”]=> string(0) “”
[“header_mobile_behavior”]=> string(0) “”
[“header_searchicon”]=> string(26) “header_searchicon_disabled”
[“header_mobile_activation”]=> string(17) “mobile_menu_phone”
[“phone”]=> string(0) “”
[“sidebarmenu_sticky”]=> string(18) “conditional_sticky”
[“layout_align_content”]=> string(20) “content_align_center”
[“sidebarmenu_widgets”]=> string(0) “”
[“sidebarmenu_social”]=> string(8) “disabled”
[“header_menu_border”]=> string(0) “”
[“header_style”]=> string(0) “”
[“blog_global_style”]=> string(0) “”
[“header_scroll_offset”]=> int(116)
[“header_transparency”]=> string(0) “”
[“header_class”]=> string(188) ” av_header_top av_logo_left av_menu_right av_large av_header_sticky av_header_shrinking av_mobile_menu_phone av_header_searchicon_disabled av_bottom_nav_disabled av_header_border_disabled”
[“header_topbar”]=> string(20) “header_topbar_active”
[“bottom_menu”]=> bool(false)
}September 11, 2016 at 3:34 am #684644Vinery, I’m stuck, bud!
The page is a mess, I don’t know what to do. I’ve googled and I’m still coming up short. It’s got nothing to do with the plugins. Take a look at what I’ve got at http://greyghost5k.com. There’s errors from the header.php in the child_theme directory. I’ve got no clue as to how to fix it and the page is looking terrible.
A free soft drink for you, my friend, if you can help me make this right.
Rock on!
September 12, 2016 at 6:11 am #684882Hi,
Could you please provide us with a temporary admin login so that we can take a closer look? You can post the details in the Private Content section of your reply.
Best regards,
RikardSeptember 12, 2016 at 6:55 pm #685310And Rikard, if you could, there’s also a huge warning on the mobile version of the site that says “New website coming soon.” Perhaps that’s a window into what’s happening across the board…
September 15, 2016 at 6:38 am #686731Hi!
The $filterable_classes or the avia_header_class_filter in the header.php file is missing. Actually, a lot of lines are missing in the header.php code that you provided above. What is the version of the theme prior to the update? I’m guessing it’s a very old version of the theme. Please get a fresh copy of the header.php file from the parent ( version 3.8 ) then override the old one. Or just disable the header.php file in the child theme folder, see if it makes any difference.
Regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.