Repeated access if no header image
-
Hi all,
If remove header image, CSS – background-image:url(‘{$bg_image_url}’) becomes background-image:url(”) , it makes every page being accessed two times:
1.2.3.4 – – [23/Mar/2020:11:10:18 +0800] “GET /index.php/sample-page/ HTTP/1.0” 200 25562 “-” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0”
1.2.3.4 – – [23/Mar/2020:11:10:19 +0800] “GET /index.php/sample-page/ HTTP/1.0” 200 25562 “https://test.com/index.php/sample-page/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:74.0) Gecko/20100101 Firefox/74.0″Here is original code of acmethemes/hooks/dynamic-css.php:
/*background*/
$bg_image_url =”;
if( get_header_image() ){
$bg_image_url = esc_url( get_header_image() );
}
$custom_css .= ”
.inner-main-title {
background-image:url(‘{$bg_image_url}’);
background-repeat:no-repeat;
background-size:cover;
background-attachment:fixed;
background-position: center;
height: {$medical_circle_header_height}px;
}”;Here is my suggested code of acmethemes/hooks/dynamic-css.php:
/*background*/
$bg_image =”;
if( get_header_image() ){
$bg_image = “background-image:url(‘” . esc_url( get_header_image() ) . “‘);”;
}
$custom_css .= ”
.inner-main-title {
{$bg_image}
background-repeat:no-repeat;
background-size:cover;
background-attachment:fixed;
background-position: center;
height: {$medical_circle_header_height}px;
}”;
- The topic ‘Repeated access if no header image’ is closed to new replies.