SitePoint Sponsor |
|
User Tag List
Results 1 to 25 of 28
-
Apr 10, 2009, 08:42 #1
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Calling image script rather than image?
Hi all!
I am developing a Wordpress theme using the NextGen plugin.
I am trying to produce a slideshow header, a la Joomla, and am well stuck on something that is probably easy!
What I mean is the site logo is displayed and the slideshow gallery operates underneath it.
Rather than call in an image file, I have tried (unsuccesfully!) to do this:
CSS Elements:
#logo {
width:960px;
background: #ff5a00 url(<?php include ('header-slideshow.php.php'); ?>) 0 0;
border-bottom: 1px solid #ff5a00;
background:#293e6b;
}
header-slidshow.phpp
<?php
if (function_exists("nggSlideshowWidget"))
{ nggSlideshowWidget(1,960,240); }
?>
Applied to main php file
<div id="logo">
<img src="main-logo.png" border="0">
</div>
Not unsurprisingly this doesn't work!
Is there a way to make it work? Google has not been my friend today!
-
Apr 10, 2009, 08:47 #2
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 Post(s)
- Tagged
- 0 Thread(s)
This seems more of a PHP issue..basically when you call the PHP file it is copy pasting in the php file.
Also check your file names again becuase in your CSS you call a .php.php file (which is strange) and you post differnet file names on here..
If you are gonna call a PHP script it has to produce some sort of echo to the background image location. If you view the source of the CSS and HTML and post it in that would be helpful in debugging (though I truly believe this is PHP related.Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Apr 10, 2009, 08:52 #3
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Doh! The double php is a red herring and typo..corrected it on my site, still no joy..
I reviewed the source as suggested and nothing appears to be linked to the called php file.
Is there a way to do what I want to do, even if it's nowhere near related to what I am trying here?
-
Apr 10, 2009, 08:56 #4
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 Post(s)
- Tagged
- 0 Thread(s)
Post the outcome please (view source) of the CSS and HTML!!
If you have a site this would be great...and no I don't think tihs is possible though I havfen't tested this personally myself (once it is written to the file I don't think you can gallery it)Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Apr 10, 2009, 08:57 #5
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
bugsnvans.com
-
Apr 10, 2009, 08:57 #6
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
By the way - the snippet of php in the second set data above was taken directly from the user manual.
-
Apr 10, 2009, 09:01 #7
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 Post(s)
- Tagged
- 0 Thread(s)
You need to set up your server to parse CSS files as PHP...Or just change the extension on the file to .php
The PHP isn't being parsed.Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Apr 10, 2009, 09:04 #8
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
Hi,
I'm not sure if this is what you are asking but if you want to include php commands within the stylesheet then take a look at this article.
http://www.barelyfitz.com/projects/csscolor/
-
Apr 10, 2009, 09:07 #9
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Thanks Paul - not quite sure that's what I want.
Thanks Ryan - thought it would be something stupid like that....cpanel here I come!
-
Apr 10, 2009, 09:10 #10
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Okay - I've added this to .htaccess
AddType application/x-httpd-php .css
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
-
Apr 10, 2009, 09:10 #11
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 Post(s)
- Tagged
- 0 Thread(s)
Once you have it parsed then post back so I can take a look at the actual outcome of the function.
Just change the extension to .php (I'm no good with apache)
Edit:
background: #ff5a00 url(<?php include ('header-slideshow.php'); ?>) 0 0;
It is still not parsing.Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Apr 10, 2009, 09:12 #12
- Join Date
- Jan 2003
- Location
- Hampshire UK
- Posts
- 40,556
- Mentioned
- 183 Post(s)
- Tagged
- 6 Thread(s)
See steps 1 and 2 in the link I posted as you can't parse the css file otherwise. More information here.
-
Apr 10, 2009, 09:13 #13
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Lol the above stopped CSS loading!
-
Apr 10, 2009, 09:16 #14
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Paul - Aha gotcha - Not sure I can do that as it's Wordpress and it calls the CSS file all over the shop.
I have added the slideshow in the body, so it works, it's just not working from within CSS...back to cpanel
-
Apr 10, 2009, 09:21 #15
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 Post(s)
- Tagged
- 0 Thread(s)
So...the site seems to have it now..(it is differnet then before). Is it what you want? (THe site is very choppy for me
)
Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Apr 10, 2009, 09:23 #16
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No I added the slide show further down in order to demonstrate that it works when hard coded into the main index.php
When I try to call it as a background in style.css it doesnt' work.
The theme is far from finished!
-
Apr 10, 2009, 09:24 #17
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 Post(s)
- Tagged
- 0 Thread(s)
Any particular reason you want it in the CSS? PHP is parsed on page load. Trying to change it after a certain amount of time/page load is not feasible/doable. Javascript is possible but actually doing it on the page would be better.
Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Apr 10, 2009, 09:29 #18
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I want the slideshow to appear under the logo - i.e. the logo appears over the slideshow as it does it's bangs and whistles...
-
Apr 10, 2009, 09:30 #19
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I've put a normal image there for now lol
-
Apr 10, 2009, 09:33 #20
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 Post(s)
- Tagged
- 0 Thread(s)
You can set the logo to position:Relative; to appear on top of the slideshow however on the actual imagse on the slideshow give it position:relative; and a higher z-index to overlap the logo image. Do you want the logo to just be there until the slideshow is loaded?
Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Apr 10, 2009, 09:40 #21
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
No I want the logo to apear all the time, with the rolling slideshow underneath....
-
Apr 10, 2009, 09:42 #22
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 Post(s)
- Tagged
- 0 Thread(s)
Then put the slideshow code underneath the <img> logo code..
Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Apr 10, 2009, 09:50 #23
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Done that but one on top of the other...
the z- position is out of myzone of comfort tbh...
-
Apr 10, 2009, 09:52 #24
- Join Date
- Oct 2008
- Location
- Whiteford, Maryland, United States
- Posts
- 13,782
- Mentioned
- 16 Post(s)
- Tagged
- 0 Thread(s)
Huh? The slideshow does not appear on top of the logo <_<..appears fine.
Always looking for web design/development work.
http://www.CodeFundamentals.com
-
Apr 10, 2009, 09:57 #25
- Join Date
- Aug 2003
- Location
- Northampton, UK
- Posts
- 70
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm after the logo over the slideshow, but what I get is the logo then the slidehshow aligned immediately after the logo
Bookmarks