WordPress.org

Forums

[resolved] Title list and one content (6 posts)

  1. hwhjryu
    Member
    Posted 3 years ago #

    Please I need some help!
    I want to have a list of posts, at the bottom, and have one post show on top.
    It would look something like this:

    ----------------------------------
    THIS IS THE FIRST TITLE
    by admin on September 18,2011

    This is the content of the first post
    Blah Blah
    Blah Blah Blah

    ----------------------------------
    THIS IS THE FIRST TITLE
    ----------------------------------
    THIS IS THE SECOND TITLE
    ----------------------------------
    THIS IS THE THIRD TITLE
    ----------------------------------
    THIS IS THE FOURTH TITLE
    ----------------------------------
    THIS IS THE FIFTH TITLE
    ----------------------------------
    prev|next

    and if you click on one of the other titles, let's say the fourth post from the list,
    then only the fourth post would show on top and the title of the fourth post gets highlighted (or bold, or change color or what not)
    And at the bottom to have a previous and next link if there were more posts.

    Any help would be greatly appreciated.
    THanks!!!

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    This might help.

  3. hwhjryu
    Member
    Posted 3 years ago #

    Thanks esmi.
    That's a start, but
    how do keep the same format even if I were to click on "This is the third title"
    so the top shows only the title and content of the third title,
    and it still shows the list of post titles at the bottom?
    So the link of the post titles would only change the content of the post on top....?

  4. chadrew
    Member
    Posted 3 years ago #

    I think you could edit single.php and add another loop under the post content, one that would give you post titles only (while excluding the content of the current post).

  5. hwhjryu
    Member
    Posted 3 years ago #

    Thanks. I got it working.
    but my navigation for previous and next page at the bottom doesn't seem to work...

    <div id="content_news">
    		<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    
    			<div class="post" id="post-<?php the_ID(); ?>">
    
    				<h2 class="post_title"><?php the_title(); ?>.</h2>
                	<div class="post_content">
                   		 <h3 class="post_meta"><?php the_date(); ?> by <?php the_author(); ?></h3>
    					<?php the_content(); ?>
         	       </div>
         	    </div>       
    
    		<?php endwhile;
    		endif;?>
    
    		<div id="news_list">
    			<?php $recent = new WP_Query("showposts=5"); while($recent->have_posts()) : $recent->the_post();?>
    			<h2 class="post_title">
    				<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
    			</h2>
    			<?php endwhile; ?>
                	<div class="navigation"><p><?php posts_nav_link(); ?></p></div>
    		</div>
    	</div>
  6. hwhjryu
    Member
    Posted 3 years ago #

    problem solved.

Topic Closed

This topic has been closed to new replies.

About this Topic