Forums

please help me how to add an image in a post (6 posts)

  1. windowsxp2005
    Member
    Posted 1 year ago #

    Hi guys I need your help. I want an image shoud show in a thumbnail view of the post. Ya all might have seen a post with a little image....

    I've used custom fields. but I dont' know what more codes i've to add in index.php of my web to get it work. or any other way that I can do it...

    Thnx

  2. churchthemer
    Member
    Posted 1 year ago #

    It depends on what you are putting in the custom field to define your thumbnail. Some people put just the file name of the image while others put the full url to the image. Also, let us know what you are calling your custom field and an example of a custom field value and we'll get you headed in the right direction.

  3. windowsxp2005
    Member
    Posted 1 year ago #

    Well I call the custom field key " Image" the value"the link of the image"
    However it's doesn't work I've tried more than 20 times. even I just put the name of image in the value field.

    Thnx

  4. churchthemer
    Member
    Posted 1 year ago #

    Assuming 2 things:

    1. Your custom field is called: Image
    2. The value of your custom field is something like: http://www.domain.com/images/myImage.jpg

    Find this code in your template file:

    <?php while (have_posts()) : the_post(); ?>

    Immediately after add:

    <?php $key="Image"; $postimage = get_post_meta($post->ID, $key, true); ?>

    To display the image add the below code anywhere in The Loop where you want the image displayed:

    <img src="<?php echo $postimage; ?>" />

    Again, this is assuming your custom field is named "Image" and the value of that field is a fully qualified URL to an image file.

    Hope that helps.

  5. windowsxp2005
    Member
    Posted 1 year ago #

    Hey I followed the exact steps as Ya said. It doesnt' display any pics at all.

  6. jessai
    Member
    Posted 1 year ago #

    You can use this plugin : http://wordpress.org/extend/plugins/multiupload-imageschack/

    you can choice the size of the thumbnail in your post

Topic Closed

This topic has been closed to new replies.

About this Topic