getThemePath vs getStylesheet
Permalink 2 users found helpful
Please if anyone could explain me the difference between getThemePath and get getStylesheet when calling Css and Js files.
Also, i created my own theme, but none of the images are showing.
Do i have to add getThemePath to each image in my website, or is there some easier way to display images?
Thanks,
Mirko
Also, i created my own theme, but none of the images are showing.
Do i have to add getThemePath to each image in my website, or is there some easier way to display images?
Thanks,
Mirko
Thanks Mike, just one thing please, do i need to add getThemePath to all images in my stylesheets and in Html?
Typically you would use getThemePath() to resolve links to images referenced in HTML. Images referenced in CSS using url() notation are resolved relative to the stylesheet. So something like this will probably work:
Of course the exact path depends on exactly where the assets are. You can use Firebug/WebKit inspector to look at network requests. It will tell you what path it is trying to use to load an image, and from that you deduce how to tweak your path.
<?php $logoSrc = $this->getThemePath()."/images/my_image.jpg"; ?> // ... in CSS, background: url(../images/my_image.jpg);
Of course the exact path depends on exactly where the assets are. You can use Firebug/WebKit inspector to look at network requests. It will tell you what path it is trying to use to load an image, and from that you deduce how to tweak your path.
Mike