Title: Help editing small PHP line: Need a variable :P
Last modified: August 19, 2016

---

# Help editing small PHP line: Need a variable :P

 *  [jjm0109](https://wordpress.org/support/users/jjm0109/)
 * (@jjm0109)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/help-editing-css-need-a-variable-p/)
 * Hi people, thanks for you support earlier.
    I’m almost done setting up my blog:
   [http://www.tropunk.com/myblog/](http://www.tropunk.com/myblog/) There’s just
   a slight problem with my theme: As you can see, there’s a slide-panel on the 
   top to add thumbnails of my posts. To add a thumbnail, I have to first add the
   image in my post and then it requires to add a custom field ‘homethumb’ and file
   name of the image as value. I did it but it didn’t seem to work. Then I saw the
   php code that generates the link for my thumbnail: `<a href="<?php the_permalink()?
   >" title="<?php the_title(); ?>" > <img src="<?php bloginfo('url'); ?>/wp-content/
   uploads/<? echo strtolower($homethumb); ?>.jpg" width="200" height="120" alt="
   <?php the_title(); ?>"/> </a>` And here I figured out the error. The link generated
   is /wp-content/uploads/filename.jpg; whereas, the image uploaded goes to /wp-
   content/uploads/2010/01/filename.jpg (As the uploads are now year/month classified)
 * So can anyone add the year/month variable in the link generator code?
    If not
   then, any mod to make my uploads stay only in one directory irrespective of time?
 * Thanks for the help.
    Jugal

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [jjm0109](https://wordpress.org/support/users/jjm0109/)
 * (@jjm0109)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/help-editing-css-need-a-variable-p/#post-1340187)
 * The image that you can see now is manually added in /wp-content/uploads/ 🙂
 *  Thread Starter [jjm0109](https://wordpress.org/support/users/jjm0109/)
 * (@jjm0109)
 * [16 years, 5 months ago](https://wordpress.org/support/topic/help-editing-css-need-a-variable-p/#post-1340208)
 * Solved: Unchecked the “Organize my uploads into month- and year-based folders”
   
   Sorry to trouble, didn’t see that before!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Help editing small PHP line: Need a variable :P’ is closed to new replies.

 * 2 replies
 * 1 participant
 * Last reply from: [jjm0109](https://wordpress.org/support/users/jjm0109/)
 * Last activity: [16 years, 5 months ago](https://wordpress.org/support/topic/help-editing-css-need-a-variable-p/#post-1340208)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
