1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Auto rename images

Discussion in 'PHP & Perl' started by reinie, Jan 23, 2011.

Thread Status:
Not open for further replies.
  1. reinie

    reinie Elite Member

    Jan 16, 2009
    Likes Received:
    Hi guys.
    Ok so I want to use the following code on my blog:

    <h3><a href="<?php the_title(); ?>.jpg" rel="lightbox"><img src="imagefolder/<?php the_title(); ?>.jpg" alt="<?php the_title(); ?>" align="left" /></a><</h3>
    I will insert it in my template at the beginning of every post, and the result is the same image being displayed eveytime a post is made, except it will change the alt tag to be the same as the title of the page, and link to the image on stand alone.

    Now the only part I do not know, is how to take the default image, say for instance picture.jpeg, and have wordpress copy and rename it everytime a new post is made so that i have uniqqe pictures accross the board.

    Can anyone please assist me with this, or is there a better way to do this?
Thread Status:
Not open for further replies.