WordPress.org

Ready to get started?Download WordPress

Forums

Display Full Size Pictures Instead of Excerpts (3 posts)

  1. Fundahstic
    Member
    Posted 3 years ago #

    My site currently displays excerpts and a thumbnail on the frontpage. I would like to put a full-size picture instead of excerpts and thumbnail. How can it be done?

    I think this is the part that display the excerpts on my index page. What changes do I have to make?

    <?php the_excerpt(); ?>
    
    			<div class="post-meta"><span class="category"><?php the_category(', ') ?></span> <span class="date"><?php the_time('F j, Y') ?></span> <span class="comments"><?php comments_popup_link('0 Comments', '1 Comment', '% Comments'); ?></span><?php edit_post_link('Edit', '| ', ' '); ?></div>
  2. keesiemeijer
    moderator
    Posted 3 years ago #

    from twentyten

    <?php
    	$images = get_children( array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC', 'numberposts' => 999 ) );
    	$total_images = count( $images );
    	$image = array_shift( $images );
    	$image_img_tag = wp_get_attachment_image( $image->ID, 'thumbnail' );
    ?>
    <a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php echo $image_img_tag; ?></a>

    change thumbnail to medium, large or full or a 2-item array representing width and height in pixels, e.g. array(32,32)

    $image_img_tag = wp_get_attachment_image( $image->ID, 'full' );

  3. Fundahstic
    Member
    Posted 3 years ago #

    Thanks for the reply.

    I have another question as well if you could help me.

    I want to remove thumbnail from my post. It displays thumbnail on the sidebar.

    <!-- Here stars the part that shows a thumb and related post to individual articles/pages -->
    <?php
    if ( is_single() || is_page()) :

    unset($photo);
    if ( current_theme_supports( 'post-thumbnails' ) && has_post_thumbnail() ) {
    the_post_thumbnail(array(310,400, true));
    }

    else{

    if ($wpzoom_cf_use == 'Yes')
    {
    $photo = get_post_meta($post->ID, $wpzoom_cf_photo, true);
    } // if CF used
    else
    {
    if (!$photo)
    {
    $photo = catch_that_image($post->ID);
    }
    } // if CF not used

    if ($photo)
    {
    ?>
    " rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><img src="<?php bloginfo('template_directory'); ?>/scripts/timthumb.php?w=310&zc=1&src=<?php echo $photo; ?>" alt="<?php the_title(); ?>" />
    <?php
    }

    } // if theme does not have a thumbnail
    ?>

    <?php endif ; ?>

    <?php
    if ( is_single() ) : ?>

    <div class="widget">
    <h3>Related Posts</h3>
    <?php wp_related_posts(); ?>
    </div>

    <?php endif ; ?>
    <!-- end -->

    How can I just remove the thumbnail from displaying and keep the text that shows related posts. Only Remove the image from that code.

    Thank You.

Topic Closed

This topic has been closed to new replies.

About this Topic