WordPress.org

Ready to get started?Download WordPress

Forums

Image of the Day? (5 posts)

  1. enero30
    Member
    Posted 4 years ago #

    Hi, I'm trying to put a image of the day box in my sidebar that can fetch images and descriptions from a folder on my server. I tried looking for a widget that could do this, but didnt have any luck. I also tried looking for some code that I could use, but nothing I found seems to work with word press.

    Does anyone out there know of anything I can do to make this happen?

    Any help would be greatly appreciated!

  2. enero30
    Member
    Posted 4 years ago #

    A little background on what I am looking for. My company's anniversary is coming up this monday, and we want to have a box in the sidebar that will display a specific image of a book each day until the end of this year. I'm trying to find a plug-in or script or anything I can do this with. But what ever I find, doesnt seem to play well with wordpress.

  3. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    if you can number the images from 1 to 365 - say 'anniversary_image_1.jpg' etc, and save them to a folder accessable to wordpress, in the simplest case, into the /images folder of the theme, then you can call them in the sidebar, hard coded with:
    <img src(<?php bloginfo('template_url'); ?>/images/anniversary_image_<?php echo date('z'); ?>.jpg) />

    no plugin, just keeping a student busy for a while to copy and number the images ;-)

  4. enero30
    Member
    Posted 4 years ago #

    Thankfully the images are already numbered and ready to go!

    Would this work with the image and text description below it as well? And what part this code do I have to alter (if any) besides the location of the images? echo date('z')? Sorry, I get a little confused with code, and am just trying to hobble this all together.

    If this works, it would be amazing, and I would send you the biggest festive cheese log you have ever seen!

  5. alchymyth
    The Sweeper & Moderator
    Posted 4 years ago #

    i overlooked that you need to show a description as well; that could be more complicated and depends on the way the description is saved and correlated to the image.

    otherwise, i would go with @numeeja's idea of a daily post.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.