WordPress.org

Ready to get started?Download WordPress

Forums

Titles in category in sidebar - 1 post showing (1 post)

  1. sepehr125
    Member
    Posted 4 years ago #

    Hi all,

    In the main content div of my page I have the following:

    <?php query_posts('category_name=homily'); ?>
    
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    
    <div class="post">
    
    <h2><?php the_title(); ?></h2>
    <?php the_time('F jS, Y'); ?>
    
    <?php the_content(); ?>
    </div>
    
             <?php endwhile; else: ?>
             <p>Sorry, no posts matched your criteria.</p>
             <?php endif; ?>

    which shows all the posts in the "homily category". What I really want is for it to show only the latest post, and then to have a sidebar div with titles of the posts in that category. I want the user to be able to click the title and read that particular post in the same page. Is what I'm looking for possible without the need to create a theme?

    Thank you,

    Sepehr

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.