Header image logic
-
Hello! We just discovered a new issue with unchanged code in the child plugin. The child theme’s header.php picks a header based on page types or post ID’s, with the below sort of logic:
<?php if ( is_home() ){ if ( function_exists( "easingsliderlite" ) ) { easingsliderlite(); } } else { $header_image = get_header_image(); if ( is_404() ) { $header_image = "https://emswcd.org/wp-content/uploads/2015/06/Header-404.jpg"; } /*else if(is_singular('product') || mp_is_shop_page() ){ $header_image = "https://emswcd.org/wp-content/uploads/2015/06/Header-native-plants-h.jpg"; }*/ else if(is_search() ){ $header_image = "https://emswcd.org/wp-content/uploads/2015/06/Header-default.jpg"; } else if(is_page(1) || in_array(1, $post->ancestors)){ $header_image = "https://emswcd.org/wp-content/uploads/2015/06/Header-default.jpg"; } else if(is_page(110) || in_array(110, $post->ancestors)){ $header_image = "https://emswcd.org/wp-content/uploads/2015/06/Header-default.jpg"; }
The problem begins with the
...else if(is_page(1) || in_array(1, $post->ancestors)){
and generates:Warning: in_array() expects parameter 2 to be array, null given in /home/content/11/12008011/html/wp-content/themes/twentytwelve-child/header.php on line 77 Warning: in_array() expects parameter 2 to be array, null given in /home/content/11/12008011/html/wp-content/themes/twentytwelve-child/header.php on line 81
and so on for each one after.
Did something change in recent versions that would cause this conflict? The header has not changed in a long time, and this issue is brand new. If there is a new page type I can use in this if else, that might solve the issue. Let me know…
Thanks!
Alex
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Header image logic’ is closed to new replies.