• I am trying to get a little creative in the layout of my blog and have taken on quite a challenge as my first theme development project.

    I want to create a semi-news portal and want to have a featured category which displays the newest post which is in featured. This should be on the left and then I want the “titles only” on the right linking to their respective posts.

    I want to fit this all in about a 500px wide wrapper.
    300 – 350px wide on the featured, printed (most recent) article, and then the next 5-7 articles as links only, no additional content, on the right side of the post.

    I have been looking at the WP loop but am slightly lost with it (and it is late) 🙂

    Any help is appreciated.

Viewing 1 replies (of 1 total)
  • I recently did something very similar and found that this code did the trick.

    <?php query_posts('category_name=events'); ?>
    <?php while (have_posts()) : the_post(); ?> 
    
    <ul>
    <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
    </ul>   
    
    <?php endwhile; ?>

    The break down:

    query_posts()

    – used before “The_Loop” to control posts that show up in “The_Loop“.

    See Category Parameters for extended configurations.

    In my example, query_posts(‘category_name=events’);, will show posts that have the category name of “events”.

    And then it’s “The_Loop“:

    <?php while (have_posts()) : the_post(); ?>

    Then show only the Title of the post, in an unordered-list:

    <ul>
    <li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
    </ul>

    Hope this helps!
    Derek M.

Viewing 1 replies (of 1 total)
  • The topic ‘Some layout issues in the WP Loop’ is closed to new replies.