Help editing small PHP line: Need a variable :P
-
Hi people, thanks for you support earlier.
I’m almost done setting up my blog: 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
The topic ‘Help editing small PHP line: Need a variable :P’ is closed to new replies.