WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] 7 days - 7 banners (19 posts)

  1. escence
    Member
    Posted 8 years ago #

    Hello

    I got an problem. Guess i will need your help - and - excuse my bad english, I am not from an english speaking nation.

    So , here I go:

    I want to have 7 Banners, 1 for each day. Starting from Sunday to Saturday ;). But what to do? If it where php it would be no prob after all. But, the style itself is using a style sheet. Quote like this for the banner:

    #header {

    height: 300px;
    margin-bottom: 35px;
    background: url(images/banner.jpg);
    text-align: center;

    }

    So, what to do? Hope anyone can help me out, it's very important to me.

    /edit: I am sorry 'bout that, but i messed up the Forum :|. It' shouldn't be here, would be nice if a mod or someone else can push it in the right one. Thanks and sorry /

  2. ifelse
    Member
    Posted 8 years ago #

    "If it where php it would be no prob after all."
    Why not define the style for the header in your header.php?

  3. escence
    Member
    Posted 8 years ago #

    Hm yes i thought about that, but:

    I fear that it will nearly destroy anything else.

    Beside that, i dont know where to place this in the header.php.

    I use "FallenLeaves" style, just want to replace the headers daily.
    Maybe you can say how to?

  4. Michael Bishop

    Posted 8 years ago #

    http://wordpress.org/support/topic/37764

    maybe this thread will shed some light on how to style.

  5. Firas
    Member
    Posted 8 years ago #

    You can do a banner.php instead of a banner.jpg, in which you check the day and do a 302 redirect. An example of this is http://photomatt.net/scripts/randomimage, but your script will be much simpler.

  6. escence
    Member
    Posted 8 years ago #

    Well thx for the quick help.

    But still i am very confused about what to do, and - i don't know where to place this.

    Maybe you can grab up my quote up there and edit it the way it should look like?

    Sorry, but i am a beginner at this.

  7. Lorelle
    Member
    Posted 8 years ago #

    First, the method of doing is based upon an important question. Do you want a specific banner image for a specific Day of the Week (like it says "Thursday" on the Thursday banner), or are you just happy rotating your 7 banners randomly per day?

    You are talking about changing the CSS when all that needs to be changed is the header image, right? Keep the banners about the same shape and size and the CSS will take care of itself. You just want to change the image. Please clarify this if it is wrong.

    The random rotating script mentioned up above involve putting the images in their own folder along with the script. Instead of linking to an image, you link to the script like this:

    <img src="/images/header/rotator.php" alt="blah" title="blah" />

    Then the images in the /images/header/` folder would just randomly generate WITH EVERY PAGE VIEW. Not by date. I use it on my site - just click my name here and go to any post and then refresh the screen and you will see the photograph in the sidebar change.

    There is a LOT more information on this in the article on WordPress headers at:

    http://codex.wordpress.org/Designing_Headers

    Your issue is the "by day" not by refresh. There are a TON of similar scripts at any of the following spots that will do what you want. You should be able to use them like the one mentioned above.

    http://www.hotscripts.com/
    http://php.resourceindex.com/
    http://www.php-scripts.com/
    http://www.onlyphp.com/

    If the only change you are making is with the CSS, you have a different problem. But if the only change you want is with the graphic, then you use this information.

  8. escence
    Member
    Posted 8 years ago #

    Yep it' s just 1 banner per day. I guess i will try this out, looks like it can help me a lot :)

    Thank you for your support.

  9. escence
    Member
    Posted 8 years ago #

    Well.. still don't work.

    I guess because i dont know where to wrote this in "<img src="/images/header/rotator.php" alt="blah" title="blah" />".

    It belongs in the style.css or? How must it look like?

    #header {

    height: 300px;
    margin-bottom: 35px;
    <img src="images/head/banner1.php">;
    text-align: center;
    }

    Don't work for me. I tried also <img.... banner1.jpg"> to test if the link is working, but still then i only get an empty header.

    Someone can help ?

  10. Sooz
    Member
    Posted 8 years ago #

    I'm using Chetan Kunte’s "plain vanilla" theme and he explains how to set up a set of header/banner images for specific pages in the comments area of the theme at

    http://chetan.ckunte.com/archives/2005/03/07/plain-vanilla-1/

    The question is comment #76 and the answer is comment #77. You should be able to adapt this for whatever theme you're using, etc.

    If you decide you want to just rotate images at random and not associate them with a specific page, I use Dan Benjamin's image rotator script that he wrote about at A List Apart:

    http://www.alistapart.com/articles/betterrotator/

    I've got it in action on my website at http://www.sooz.com

  11. Sooz
    Member
    Posted 8 years ago #

    Oops I missread your original question. I see you want something "by day" and not "by page." Well, in case you change your mind, maybe this will be helpful or I'm sure it can be tweaked for something day specific ... I'm just not enough of a geek to know how to do that.

  12. Firas
    Member
    Posted 8 years ago #

    <?php

    /* Path to images */
    $folder = 'http://example.com/wp-content/banners/days/';

    /* Today's day */
    $day = date('l');

    /* Extension */
    $ext = '.jpg';

    /* Join them for file path */
    $path = $folder . $day . $ext;

    /* Go! */
    header('Location: '.$path);

    ?>

    So you'll have Sunday.jpg, Monday.jpg, etc.

  13. escence
    Member
    Posted 8 years ago #

    @Sooz thx for your help, maybe i will come back to it if i dont get antything else to use.

    @Firas thx fpr help as well, but still , you didnt answered my question really... because i still dont know where to place this stuff and how to link it from the style.css.

    Hope for help.. as always ;)

  14. Firas
    Member
    Posted 8 years ago #

    Save that code to a file called banner.php. Customize the path and extension.

    Put banner.php in your theme folder's images/ folder.

    In your css, change background: url(images/banner.jpg); to background: url(images/banner.php);.

  15. escence
    Member
    Posted 8 years ago #

    Ok it working for me so far. But I got one last question left.

    It is possible to extend this from Monday-Sunday.jpg to the Date 1st of month to 31th of month?

    I know , i didnt asked this @ the beginning, but it woul be very helpful to know this for later usage maybe.

  16. Firas
    Member
    Posted 8 years ago #

    Just pass the right arguments to the date() function. That link looks kinda complicated at first glance but scroll down and you'll see a table of what to send to get your desired output. In this case, instead of l, you'll want to send j.

  17. escence
    Member
    Posted 8 years ago #

    Yippi :D

    Now it' is working quite fine.
    After all work it look like this http://www.escence.de , with a Banner that changes every day.

    Thank you for your help @ all and specially thx Firas

  18. vkaryl
    Member
    Posted 8 years ago #

    That's pretty nifty, Firas! Thanks.... and maybe make it into a plugin?

  19. bosal
    Member
    Posted 7 years ago #

    how to make it, that it display img 13112006.jpg on 13.12.2006 etc... ?

    How to modify it that it makes a thumbnail and on click it goes to the img?

    How to make a title for every img ?

Topic Closed

This topic has been closed to new replies.

About this Topic