HELP: Urban Elements theme - Post Thumbnail Options

Discussion in 'WordPress' started by EvoWRZ®, Oct 9, 2010.

  1. #1
    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.
     
    EvoWRZ®, Oct 9, 2010 IP
  2. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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:
     
    Cash Nebula, Oct 9, 2010 IP
    EvoWRZ® likes this.
  3. EvoWRZ®

    EvoWRZ® Notable Member

    Messages:
    741
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    210
    #3
    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.. :(
     
    EvoWRZ®, Oct 9, 2010 IP
  4. MiletNZ

    MiletNZ Member

    Messages:
    283
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    30
    #4
    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.
     
    MiletNZ, Oct 9, 2010 IP
    EvoWRZ® likes this.
  5. EvoWRZ®

    EvoWRZ® Notable Member

    Messages:
    741
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    210
    #5
    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").
     
    EvoWRZ®, Oct 9, 2010 IP
  6. EvoWRZ®

    EvoWRZ® Notable Member

    Messages:
    741
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    210
    #6
    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.
     
    EvoWRZ®, Oct 11, 2010 IP
  7. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #7
    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.
     
    Cash Nebula, Oct 11, 2010 IP
  8. EvoWRZ®

    EvoWRZ® Notable Member

    Messages:
    741
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    210
    #8
    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">&nbsp;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.
     
    Last edited: Oct 11, 2010
    EvoWRZ®, Oct 11, 2010 IP
  9. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Sorry, forgot to change the parameter to an argument :eek: 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 :)
     
    Cash Nebula, Oct 12, 2010 IP
  10. EvoWRZ®

    EvoWRZ® Notable Member

    Messages:
    741
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    210
    #10
    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. :eek:
     
    EvoWRZ®, Oct 12, 2010 IP
  11. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Well spotted! :cool:

    Sorry that you wasted all that time, I really should stop and check what I post once in a while :rolleyes:
     
    Cash Nebula, Oct 13, 2010 IP