• brody_zen

    (@brody_zen)


    I have a page with multiple div’s
    each div shows specific categories and each div only shows specific a attributes for each post.

    For example one div might show 3 post form the news category. it will also only sho the title and the excerpt.

    i have one that needs to display the title excerpt and a thumbnail. i cant get the thumbnail to display. i have provided the code for that div.

    any help would be greatly appreciated and any additional information need with be provided asap.

    thanks

    <div id="press"><br /><h9>PRESS RELEASES</h9><br />
    ...........................................................................................................................................................................................................................................
      <ul>
    <?php
    global $post;
    $myposts = get_posts('numberposts=3&category=1');
    foreach($myposts as $post) :
    ?>
    <li><p><strong><?php the_title(); ?>::</strong><br />
    <?php the_excerpt_rss(20,1); ?> </p></li>
    <?php endforeach; ?>
    </ul>
        </div>
Viewing 15 replies - 1 through 15 (of 22 total)
  • Chip Bennett

    (@chipbennett)

    First, I assume you have support enabled for Post Thumbnails in functions.php?

    add_theme_support( 'post-thumbnails' );

    Then, in your output code (as linked above), you need to call the_post_thumbnail(), e.g.:

    foreach($myposts as $post) :
    ?>
    <li><p><strong><?php the_title(); ?>::</strong><br />
    <?php the_post_thumbnail( 'thumbnail' ); ?>
    <?php the_excerpt_rss(20,1); ?> </p></li>
    <?php endforeach; ?>

    Thread Starter brody_zen

    (@brody_zen)

    Chip.

    Thanks for responding so quickly.

    I am using the twenty ten theme. I checked the function.php and it did contain the add_ theme_support code in it.

    I added you code to the featured-post.php that is populating the page and i still get no thumbnails.

    Is there something i need to be doing at the time i upload an image to create the thumbnail? I kinda thought that all of those were created at upload time?

    Chip Bennett

    (@chipbennett)

    Have you defined a “Featured Image” for the posts for which you wish to display the Post Thumbnail?

    Thread Starter brody_zen

    (@brody_zen)

    Yes i have.

    Chip Bennett

    (@chipbennett)

    Can you post pastebins of

    1) The PHP file in question
    2) The rendered HTML output

    Thread Starter brody_zen

    (@brody_zen)

    [Edited – Know how Chip mentioned pastebin? Yeah. Large code excerpt removed by moderator per forum rules. Please use the pastebin for all large code excerpts. It works better anyway.]

    Thread Starter brody_zen

    (@brody_zen)

    Chip Bennett

    (@chipbennett)

    The the_post_thumbnail() just isn’t outputting anything at all.

    Try replacing this:

    <?php the_post_thumbnail( 'thumbnail' ); ?>

    With this:

    <?php the_post_thumbnail( 'post-thumbnail' ); ?>

    Or even this:

    <?php the_post_thumbnail(); ?>

    And see if you get anything output.

    Thread Starter brody_zen

    (@brody_zen)

    Still nothing. ??

    i found a plugin called Thumbnail For Excerpts.
    i is supposed to add thumbnails to excerpts.
    If the post has not thumbnail then it displays a default image.

    On all the posts being displayed on that page, that have excerpts, the plug in displays the default image. does that mean the posts don’t have a thumbnail relative to them?
    They have featured images.

    arrgghhh

    Chip Bennett

    (@chipbennett)

    What is a “default image”?

    I would assume that this behavior means that the Posts in question do not, in fact, have an assigned “Featured Image”.

    To find out: go to the post-edit screen for each of the Posts, and ensure that an image is defined in the “Featured Image” metabox in the right-hand sidebar.

    Thread Starter brody_zen

    (@brody_zen)

    I checked that and they all hvae the featured image assigned.

    Default image is just an image provided by the plugin that acts as a place holder if there is no thumbnail assigned to the post.

    also i went to my uploads folder and each image uploaded has three versions

    one at 80×150
    one at 214×300
    and
    One at 234×300

    and of coarse the original.

    Chip Bennett

    (@chipbennett)

    Can you post your functions.php file in a Pastebin?

    Primarily, I’m looking for anything like the following:

    add_theme_support( 'post-thumbnails' );
    set_post_thumbnail_size();
    add_image_size();
    Thread Starter brody_zen

    (@brody_zen)

    also.
    I just went in and removed the featured image and replaced it to no avail.

    Thread Starter brody_zen

    (@brody_zen)

    Thread Starter brody_zen

    (@brody_zen)

    Also i don’t know if this makes a difference but the featured-post.php lives inside a folder in the theme folder named php

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Display post thumbnails’ is closed to new replies.