• I’ve bumped into some unexpected trouble which I have not had before. When I call query_posts to display a custom field for showing image thumbnails, I use:

    <?php query_posts("cat=20&showposts=5&order=ASC");  ?>
    <?php while (have_posts()) : the_post(); ?>
    
    <a href="<?php the_permalink() ?>" title="<?php the_title(); ?>">
    	<img src="<?php echo get_post_meta($post->ID, 'Image', true); ?>" alt="Icon for Post #<?php the_ID(); ?>" />
    </a>
    <?php the_excerpt(); ?>
    <?php endwhile; ?>

    However, the thumbnails do not show. They do not show because when I see the html markup, the index.php file does not output the full url, only: /image1.jpg and not the full directory. For some strange reason, other images I have seem to work but it pulls this from a totally different folder of another wordpress blog I am also using.

    I tried uploading the full url path in Settings and that took no effect at all.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter mhuynh55

    (@mhuynh55)

    In the Custom Field, I just add the image name: image.jpg. On my other blog, this works perfectly ok but for this new blog I created, it does not work.

    I had a similar problem where my pictures didn’t show up when I started to use “query_posts”. I fixed it by, instead of specifying the category that I wanted, specifying the categories I did not want (with a negative sign and commas… “cat=-3,-4,-6,-7”). Hope that works for you! If it doesn’t, I have no idea.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Trouble with query_posts and image thumbs’ is closed to new replies.