Forums

Displaying Posts in Category pages with only Images. How to?? (3 posts)

  1. gopeterb
    Member
    Posted 2 years ago #

    Hi all,

    I would like to have my category pages display my blog posts with only images, like this:

    HERE

    ...each image would represent a blog post. No content show at all.

    Does anyone have an idea as to how I would go about this? Maybe using a few plugins in conjunction with each other somehow?

    Any help on this would be greatly appreciated!!!!

  2. gopeterb
    Member
    Posted 2 years ago #

    anyone? Can this be done with post thumbnails?

  3. gopeterb
    Member
    Posted 2 years ago #

    NEVERMIND WORDPRESS COMMUNITY!!!!

    I figured it out myself. Since I am a nice guy and know that someone will come across this post one day...here is what I did to achieve the look in the site above:

    1. Enabled post thumbnails in WP 2.9
    2. Went into my archives.php file, pasted in the code for the thumbnail display and deleted all the calls to the Post Title Permalink, date, comments, content...everything.

    All that was left was the call to each of the post thumbnails.

    3. I then had to link each thumbnail to the post, like this:

    <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail(); ?></a>

    Here is the chunk of code from the top of my archive.php file before and after for reference.
    Before:

    <?php get_header(); ?>
    
    <div id="content">
    
    	<div id="contentleft">
    
    		<div class="postarea">
    
    		<?php include(TEMPLATEPATH."/breadcrumb.php");?>
    
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    			<h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    
    			<div class="date">
    
    				<div class="dateleft">
    					<p><span class="time"><?php the_time('F j, Y'); ?></span> <?php _e("by", 'maf'); ?> <?php the_author_posts_link(); ?> &nbsp;<?php edit_post_link(__('(Edit)', 'maf'), '', ''); ?> <br /> <?php _e("Filed under", 'maf'); ?> <?php the_category(', ') ?></p>
    				</div>
    
    				<div class="dateright">
    					<p><span class="icomment"><a href="<?php the_permalink(); ?>#comments"><?php comments_number(__('Leave a Comment', 'maf'), __('1 Comment', 'maf'), __('% Comments', 'maf')); ?></a></span></p>
    				</div>
    
    			</div>
    
    			<div class="clear"></div>
    
    			<?php the_excerpt(); ?><div class="clear"></div>
    
    			<div class="postmeta2">
    				<p><span class="tags"><?php _e("Tags", 'maf'); ?>: <?php the_tags('') ?></span></p>
    			</div>
    
    			<?php endwhile; else: ?>
    
    			<p><?php _e('Sorry, no posts matched your criteria.', 'maf'); ?></p><?php endif; ?>
    			<p><?php posts_nav_link(' — ', __('&laquo; Previous Page', 'maf'), __('Next Page &raquo;', 'maf')); ?></p>
    
    		</div>

    After:

    <?php get_header(); ?>
    <div id="content">
    
    	<div id="contentleft-archive">
    
    		<div class="postarea-archive">
    
    		<?php include(TEMPLATEPATH."/breadcrumb.php");?> <br /><br />
    
    			<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail(); ?></a>
    
    			<?php endwhile; else: ?>

Topic Closed

This topic has been closed to new replies.

About this Topic