I've been working on a wordpress project for the past few days on my localhost. When I was done with it, I tried uploading it on my live host. But when the installation was finished, it showed a syntax error, saying "Parse error: syntax error, unexpected '[' in ..."
The code is the following :
function Consulin_header_style() {
if (Consulin_meta('enable_custom_header_style') == 1):
$images = Consulin_decode(Consulin_meta( 'header_image'));
$header_images = '.page-title { background-image: url('. wp_get_attachment_image_src($images[0],'flat-page-title')[0].');}';
else:
if ( get_header_image() != "" ) {
$header_images = '.page-title { background-image: url('. get_header_image().');}';
} else {
$header_images = '.page-title { background-image: url('.CONSULIN_LINK.'images/page-title.jpg) ; }';
}
endif;
wp_add_inline_style( 'Consulin-style', $header_images );
}
The 4th line of the code which says "$header_images = ..." is the problem. I have absolute zero knowledge of programming, so I'd appreciate some help here.
P.S: It works perfectly fine on localhost.