CSS link issue
PermalinkI am having a senior moment, I have a new custom theme that I have installed on my XAMPP but for some reason when I try and look at it in C5 I don't see any CSS. I am guessing it is just not linking but I cant for the life of me see why, here is the link I am using.
<link href="<?=echo $ this->getThemePath()?>/style.css" rel="stylesheet" type="text/css" />
I have cleared the cache and tried variations of the link but I am getting nowhere fast.
Any suggestions or ideas greatly appreciated.
The theme installed ok, its just when I look at the installed theme I don't see the CSS being applied.
It's a plain old, currently being built by me theme.
My old brain cells are hurting on this one as I have several C5 sites live and I am using the link above in them.
Any other thoughts on what could knock out the CSS?
<link href="<?php echo $this->getStyleSheet('style.css')?>" rel="stylesheet" type="text/css" media="screen" />
or try
<link rel="stylesheet" media="screen" type="text/css" href="<?=$this->getStyleSheet('style.css')?>" />
I have now tried this out on my XAMPP and a live hosting package but with the same results. Each time the theme wont link to the CSS.
I am using a page with no extra code in so still the original HTML with out any editable areas but I do have the following code at the very top of my default.php
<?php defined('C5_EXECUTE') or die(_("Access Denied.")); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <?php Loader::element('header_required'); ?> <link href="<?php echo $this->getStyleSheet('style.css')?>" rel="stylesheet" type="text/css" media="screen" /> </head>
This is the code suggested by 12345j and seems to me like it should work.
The CSS style sheet is called style.css and is in the same directory as the default.php.
I know I am going to find there is a glaringly obvious reason that is going to make me deeply embarrassed but I got to keep plugging away at this.
Update:
I loaded the page up to my dev account and think I have seen what is causing the problem. There seems to be an exta / appearing in the link to the CSS. I am a bit stuck now because I dont know how that extra / is getting in there.
Problem fixed.
Hint for future people, dont use a theme name with either a space in it or capital letters, not sure which of those it was so I changed both.
Skulks away from the forum in shame.
Thanks again to the guys that took the time to answer.
<?=echo
This means echo already:
<?=
<?php echo
it should be
<link href="<?=$this->getThemePath()?>/style.css" rel="stylesheet" type="text/css" />
the default theme is using a different method to allow customization of the theme in the backend. here's the code
<link rel="stylesheet" media="screen" type="text/css" href="<?php echo $this->getStyleSheet('main.css')?>" />
It needs to be in the sitemap/themes folder and installed via dashboard/pages_and_themes.
You prob did that :)
Is this a packaged theme or plain ole theme?