WordPress.org

Ready to get started?Download WordPress

Forums

Show full posts on home page (6 posts)

  1. wpfiend
    Member
    Posted 3 years ago #

    Hello experts:

    The first entry on the home page is a collection of images. If I add another post, then both the post appear only as the title.

    How do I make all my posts appear as FULL posts including images on the home page???

    I have attached the code from home.php.

    Or is there some setting I can click to get this result??

    Thanx in advance,

    --wpf.

  2. wpfiend
    Member
    Posted 3 years ago #

    Sorry, speed kills.

    Here is the promised code.

    --wpf.

    <div class="home"><!-- begin home -->
    
    		<?php query_posts('showposts=1'); // this shows the latest post you have written ?>
    		<?php while (have_posts()) : the_post(); ?>
    		<div class="post" id="post-<?php the_ID(); ?>">
    		<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    		<h3>by <?php the_author() ?> | <?php the_time('F jS, Y') ?> | Filed under: <?php the_category(', ') ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></h3>
    				<div class="entry">
    					<?php the_content('continue reading'); ?>
    				</div>
    			<?php if (function_exists('the_tags')) { the_tags('<p>Tags: ', ', ', '</p>'); } ?>
    			<?php edit_post_link('[edit]', '<p class="edit">', '</p>'); ?>
    		</div>
    			<?php endwhile; ?>
    </div><!-- end home -->
    
    <div class="spacer"></div> <!-- the hr below the first post -->
    
    <div class="recentposts"><!-- begin recent posts -->
    
    		<?php query_posts("offset=1"); // you can chage how many posts are shown through your WordPress dashboard = settings = reading ?>
    		<?php while (have_posts()) : the_post(); ?>
    		<div class="repost" id="post-<?php the_ID(); ?>">
    		<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h2>
    		<p class="repostmetadata"><?php the_time('F jS, Y') ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?><br/>
        	<?php if(function_exists("the_tags")) the_tags('Tags: ', ', ', ''); ?></p>
    
    		</div>
    		<?php endwhile; ?>
  3. Gisha James
    Member
    Posted 3 years ago #

    Code looks ok, it should display the most recent post in full at the top.
    Try by adding <?php wp_reset_query(); ?> after first loop.

  4. wpfiend
    Member
    Posted 3 years ago #

    Hi.

    Thanx for the response.

    I applied your suggestion. If I enter another post, it does show the whole post now. But the next post (older) is displayed as only the Title.

    Any ideas??

    --wpf.

  5. Gisha James
    Member
    Posted 3 years ago #

    In the second loop, it is supposed to show only the title. If you want to show the content, you have to add <?php the_content('continue reading'); ?>
    in the second loop

  6. wpfiend
    Member
    Posted 3 years ago #

    Thank you so much for your help.

    That worked exactly like I needed it.

    Regards,

    --wpf.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.