WordPress.org

Ready to get started?Download WordPress

Forums

Images via custom fields on new theme (4 posts)

  1. Geetar
    Member
    Posted 3 years ago #

    Hi,

    My website gets the post thumbnail via custom fields: Key: Thumbnail, Value: /mydomain.com/wp-content/uploads/thepicturesfolder/thepic.jpg

    The theme uses this code to get the thumbnail:

    <?php } elseif (get_post_meta($post->ID, 'Thumbnail', true) ) {?>

    The image is resized using Timthumb which is included in the theme inside a folder called "scripts" /scripts/timthumb.php

    I want to use a new theme which uses two different image sizes, and has several rows. The theme calls the image by using the following code:

    <img src="<?php get_the_image(); ?>" width="300" height="169" alt="" border="0" vspace="5" />

    And the thumbnail on the row using 120x68 thumbnails:

    <div class="img_left"><a href="<?php echo the_permalink(); ?>"><?php the_post_thumbnail(); ?></a></div>

    I'd like to use the new theme without having to add manually all the images again.

    Which code should I use instead of <img src="<?php get_the_image(); ?>" width="300" height="169" alt="" border="0" vspace="5" /> for images 300x169 and <div class="img_left"><a href="<?php echo the_permalink(); ?>"><?php the_post_thumbnail(); ?></a></div> for 120x68 thumbnails?

    Thanks in advance, any help will be greatly appreciated.

  2. Geetar
    Member
    Posted 3 years ago #

    Anyone?

    I am using custom fields to display thumbnails Key: "Thumbnail" Value: the url to the image which is hosted on my server. My Theme uses 2 different image sizes. Big images are displaying without problems, however the small thumbnails are not displaying.

    Thumbnails are resized using timthumb wich is hosted in the same theme directory.

    In order to display the child thumbnails, what I need to change on the following code? (loop.php)

    [code moderated - please use pastebin.com for chunks of code]

    Thanks in advance, any help will be greatly appreciated.

  3. Geetar
    Member
    Posted 3 years ago #

    Sorry but I'm unable to edit my last post so here's the code:

    http://pastebin.com/fT36Dtug

  4. Geetar
    Member
    Posted 3 years ago #

    Can you please delete this thread?

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic