html - Using PHP to generate part of a background URL in CSS-file -
i need php generate part of path name background image, used in css-file. changed file type php , added header, suggested in post on stackoverflow. however, cannot work. believe php generates , error , terminates other code after that, not sure how acquire error message. code is:
<?php header('content-type: text/css'); ?> body { min-height: 100%; background: url("<?php echo asset_url(); ?>images/backgroundimage.jpg"); background-size: cover; background-repeat: no-repeat; background-position: center top; }
the asset_url()
function has been tested, , working elsewhere, should not issue. example of working here:
<link rel="stylesheet" type="text/css" href="<?php echo asset_url(); ?>css/basicstyle.php">
am missing totally obvious here?
update: pretty sure css loaded, worked before changed php (i did not change else). inspection of site, once uploaded, shows following in
<link rel="stylesheet" type="text/css" href="http://e-drift.dk/assets/css/basicstyle.php">
however none of css in file applied correctly, not thing.
are sure you're including required includes?
your error message shows this;
call undefined function asset_url() in /var/www/web/web694777/e-drift.dk/assets/css/basicstyle.php on line 7
Comments
Post a Comment