Thumbnails not showing…?
-
Ok so I’ve got a wordpress theme that uses the following code in order to post thumbnails next to the posts.
<?php $customfields = get_post_custom(); $scrp = get_bloginfo('wpurl') . '/wp-content/themes/magasin-uno/functions/timthumb.php?'; if (empty($customfields['paddimage'][0])) { $imgpath = $scrp . 'src=' . get_bloginfo('wpurl') . '/wp-content/themes/magasin-uno/images/thumbnail.png' . '&w=68&h=68&zc=1'; } else { $imgpath = $scrp . 'src=' . get_bloginfo('wpurl') . $customfields['paddimage'][0] . '&w=68&h=68&zc=1'; } ?>
I tried to highlight the important stuff in bold to make it easier to read…
The code takes whatever is in the “paddimage” field and uses that url as the thumbnail image. I’ve tried using both the hxxp://myurl.com/wp-content… etc version and the /wp-content/the…. version of the url for the image in the “paddimage” field, and have had no luck getting anything to show.
timthumb.php is a program that is supposed to re-size the images to whatever you put in the “w” and “h” variables. I have timthumb installed in the directory it refers to (/wp-content/magasin-uno/functions), however it does not show any image at all. Instead, all I get is the ALT content (the post title) in a box where the image should be.
Looking at the code, it seems to me that if there is no image, or at least if the “paddimage” field is empty or doesn’t exist, then there should be a file called “thumbnail.png” which should show up as a placeholder. That does not show up either even though it is in the proper directory.
NOTE: All this stuff came with the theme. I have seen a demo version of it set up with working thumbnails so I must be doing something wrong.
- The topic ‘Thumbnails not showing…?’ is closed to new replies.