Hi DPers, Im having a problem with Urban Elements theme thumbnails, it doest show up. I installed the Simple Post Thumbnails plugin and uploaded the image from the PC but i don`t see it show up with the post. This is the code of the thumbnail div in Index.php.. <div class="postthumb" style="display: <?php echo get_option('toggle_thumbnails'); ?>;"> <a href="<?php the_permalink() ?>" title="Continue Reading: <?php the_title() ?>"><img class="postimage" style="background: url(<?php $key="thumbnail"; echo get_post_meta($post->ID, $key, true); ?>) top left no-repeat;" src="<?php bloginfo('template_url'); ?>/images/postimage.png" jg="imghover" jg:imghover="fade:false,src:'<?php bloginfo('template_url'); ?>/images/postimage.alt.png'" alt="<?php the_title() ?>" /></a> </div> PHP: Any solution? Thanks.
This may sound dumb, but have you checked the theme options? Going by that code, there must be a checkbox or something for showing thumbnails. Did you install the theme and the "Simple Post Thumbnails" plugin? The features list says it's already part of the theme. The plugin has its own requirements and options:
Yeah, i checked the theme option and "Post Thumbnail Options" not disabled. I need to install "Simple Post Thumbnails" plugin to make Thumbnail Option show in "Settings > Thumbnail Options" and also in when i make new post "Add New". I found the "thumbnails" folder in wp-content with permissions (755 works) and I guess that my host support GD graphics, that's my phpinfo: PHP Version 5.2.13 gd GD Support enabled GD Version bundled (2.0.34 compatible) FreeType Support enabled FreeType Linkage with freetype FreeType Version 2.2.1 GIF Read Support enabled GIF Create Support enabled JPG Support enabled PNG Support enabled WBMP Support enabled XPM Support enabled XBM Support enabled I don`t know what to do to make the thumbnails show, yet..
Have you double checked that your host has the GD graphics extension for PHP enabled? I had to email mine to make sure. Also a silly one but double check the path to images are correct.
I just opened a support ticket to make sure that it is enabled, waiting for a replay. I also double check the image url, it`s correct (When i upload from PC, it show up in "wp-content/thumbnails" I also tried "Upload via URL").
I just confirmed with my host support that GD graphics are enabled. I think it has something to do with the code i posted and the plugin installation.. It says.. Can you guys somehow integrate the code i post with that installation, i got the feeling that it would work. Thanks in advance.
Does the readme specifically say to install the plugin? If the plugin is already part of the theme, installing it again may cause problems. I would have a look in functions.php to see if there is any mention of it This might work: <div class="postthumb" style="display: <?php echo get_option('toggle_thumbnails'); ?>;"> <a href="<?php the_permalink() ?>" title="Continue Reading: <?php the_title() ?>"><img class="postimage" style="background: url(<?php p75GetOriginalImage(int $postID) ?>) top left no-repeat;" src="<?php bloginfo('template_url'); ?>/images/postimage.png" jg="imghover" jg:imghover="fade:false,src:'<?php bloginfo('template_url'); ?>/images/postimage.alt.png'" alt="<?php the_title() ?>" /></a> </div> Code (markup): I replaced $key="thumbnail"; echo get_post_meta($post->ID, $key, true); with p75GetOriginalImage(int $postID) , because the postimage pngs are just borders.
It says that i need to install the plugin, they use it in theme demo site. Thats the code i found in functions.php.. <!-- begin thumbnail options --> <h2>Post Thumbnail Options</h2> <div style="margin:0;padding:0;"> <label><input type="checkbox" id="toggle_thumbnails" name="toggle_thumbnails" <?php checked('none', get_option('toggle_thumbnails')); ?> value="none"> Check to Disable <strong>Post Thumbnails</strong></label> </div><br /> <div style="border-bottom: 1px solid #999;"></div><br /> <!-- end thumbnail options --> PHP: I got this "Parse error: syntax error, unexpected T_VARIABLE" in index.php after adding the code you mentioned above.
Sorry, forgot to change the parameter to an argument It should be $post->ID instead of $postID, that makes more sense. <div class="postthumb" style="display: <?php echo get_option('toggle_thumbnails'); ?>;"> <a href="<?php the_permalink() ?>" title="Continue Reading: <?php the_title() ?>"><img class="postimage" style="background: url(<?php p75GetOriginalImage($post->ID) ?>) top left no-repeat;" src="<?php bloginfo('template_url'); ?>/images/postimage.png" jg="imghover" jg:imghover="fade:false,src:'<?php bloginfo('template_url'); ?>/images/postimage.alt.png'" alt="<?php the_title() ?>" /></a> </div> Code (markup): That's the only code for thumbnails? Wow, I really expected the plugin to be integrated, but I guess there was a problem with doing that. Thanks for the rep
YESSS BAZINGOO!! You`re right dude. It was in "$key="thumbnail"; echo get_post_meta($post->ID, $key, true);" part, I added "<?php p75GetOriginalImage($post->ID) ?>" but it did`t work. After 1.5H of trying and figuring i end up adding "echo" in the code to look like "<?php echo p75GetThumbnail($post->ID); ?>" and IT WORKED. Final div code.. <div class="postthumb" style="display: <?php echo get_option('toggle_thumbnails'); ?>;"> <a href="<?php the_permalink() ?>" title="Continue Reading: <?php the_title() ?>"><img class="postimage" style="background: url(<?php echo p75GetThumbnail($post->ID); ?>) top left no-repeat;" src="<?php bloginfo('template_url'); ?>/images/postimage.png" jg="imghover" jg:imghover="fade:false,src:'<?php bloginfo('template_url'); ?>/images/postimage.alt.png'" alt="<?php the_title() ?>" /></a> </div> PHP: Thanks again, i would`t be able to fix that problem without you.
Well spotted! Sorry that you wasted all that time, I really should stop and check what I post once in a while