• Resolved formica

    (@formica)


    Hi

    I’m close to solving this but think my php is letting me down.

    I’m asking wordpress to loop through and echo the thumbnails and custom fields of various posts in a certain category.

    It spits out the correct thumbnails from all the posts in that cat’ but only gives the custom field from the current post.

    Here’s the code – please can some tell me where i’m going wrong!

    `
    $result = “<div>”;
    $catposts = get_posts(‘category=8&numberposts=100&order=ASC&orderby=title’);

    foreach($catposts as $single):
    $customField = get_post_custom_values(‘blue_title’);
    $result .= “<a href='”;
    $result .=get_permalink($single->ID).”‘><img src='”.p75GetThumbnail($single->ID, 85, 58).” style=’border=none’ />$customField[0]”;
    endforeach;
    $result .= “</div>”;
    echo $result;

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Displaying custom fields and thumbnails of posts in category’ is closed to new replies.