SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 28
  1. #1
    SitePoint Enthusiast
    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!

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 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

  3. #3
    SitePoint Enthusiast
    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?

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 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

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Northampton, UK
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    bugsnvans.com

  6. #6
    SitePoint Enthusiast
    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.

  7. #7
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 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

  8. #8
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,376
    Mentioned
    180 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/

  9. #9
    SitePoint Enthusiast
    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!

  10. #10
    SitePoint Enthusiast
    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
    ...still no joy!

  11. #11
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 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

  12. #12
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,376
    Mentioned
    180 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.

  13. #13
    SitePoint Enthusiast
    Join Date
    Aug 2003
    Location
    Northampton, UK
    Posts
    70
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Lol the above stopped CSS loading!

  14. #14
    SitePoint Enthusiast
    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

  15. #15
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 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

  16. #16
    SitePoint Enthusiast
    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!

  17. #17
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 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

  18. #18
    SitePoint Enthusiast
    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...

  19. #19
    SitePoint Enthusiast
    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

  20. #20
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 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

  21. #21
    SitePoint Enthusiast
    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....

  22. #22
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 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

  23. #23
    SitePoint Enthusiast
    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...

  24. #24
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,623
    Mentioned
    6 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

  25. #25
    SitePoint Enthusiast
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •