• Resolved haywars

    (@haywars)


    Hello everyone,

    Im trying to change the way my posts are displayed which I think have to be changed in the CSS. But theres a few issues.

    The site is located 2D-X Test

    Right now I have a Top Stories area which displays only posts from one category with this code :

    <ul>
    <?php
    global $post;
    $myposts = get_posts('numberposts=3&category=3');
    foreach($myposts as $post) :
    ?>
    
    <li><a>"><?php the_title(); ?></a></li>
    <?php endforeach; ?>
    </ul>

    But I would like it to show up just like how IGN has their Top Stories area with a Picture Floating Left and the Post to the right.

    Right now I only have them displaying Permalinks.

    Any help would be great! Cheers.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You’d need to change the template code above as well as your CSS. See this Codex page for an example.

    Thread Starter haywars

    (@haywars)

    Thanks esmi. Got the code to what I want it to be.

    <h1>Top Stories</h1>
      <?php
     $postslist = get_posts('numberposts=3&order=ASC&category=3');
     foreach ($postslist as $post) :
        setup_postdata($post);
     ?>
     <div>
     <h5><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h5> <?php the_date(); ?>
     <?php the_content(__('Read more'));?><div style="clear:both;"></div>
     <?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?><br />
     </div>
     <?php endforeach; ?>

    Ill change the CSS later on to fit my needs. But I was wondering about the Picture situation, does that have to be added within the CSS? but then it would display the same picture for each post….its kind of a head scratcher.

    If it can be done that would be great but I just need to be pointed in the right direction.

    Cheers!

    Thread Starter haywars

    (@haywars)

    Actually I have figured out how to add the images. It was fairly easy.

    Thank you for all the help!

    Glad to hear that you managed to get it sorted. 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Post Display Style’ is closed to new replies.