Support » Themes and Templates » [Resolved] Index entries laid out differently

[Resolved] Index entries laid out differently

  • I used to have some code that allowed me to have entries on the index page displayed differently – it was a very specific code I used to create a news wordpress theme but I have now lost it.

    The first one drew the most recent entry and allow me to display it like a feature.

    The second piece of code drew the next three or so number of articles and displayed them underneath – it had a special little feature which basically said display three entries starting at the second most recent post.

    Have looked everywhere but cant find something similar. Can anyone help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • OK. By searching the forums I managed to find this, which outlines what I want. Anyone got any ideas how I can do it.

    Basically I used the post-teaser plugin to only show the first 100 characters of a post and restricted the homepage to display 1 post at a time. The normal loop was in a div called latestpost

    I then found in the Wikki the useful get_posts template tag – so I then created another div called recentposts and used the get_posts function to return the title and excerpt from the most recent 3 posts (using an offset of 1 to miss the latest post).

    Still working on this… but going wrong somewhere.

    Can anyone tell me where I have gone wrong here

    $myposts = get_posts(‘numberposts=1’);
    foreach($lastposts as $post) :
    <div class=”topNewsDate”>Top News – <?php the_date(”,'<h2>’,'</h2>’); ?></div>

    <div class=”newsOne”>
    <h2>” rel=”bookmark”><?php the_title(); ?></h2>
    <?php the_content(__(‘(more…)’)); ?>
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__(‘Comments (0)’), __(‘Comments (1)’), __(‘Comments (%)’)); ?>
    <?php comments_template(); // Get wp-comments.php template ?>
    <?php endforeach; ?>

    <div class=”newsTwo”>
    $myposts = get_posts(‘numberposts=1&offset=1’);
    foreach($lastposts as $post) :
    ” id=”post-<?php the_ID(); ?>”><?php the_title(); ?>
    <?php the_content(); ?>
    <?php endforeach; ?>

    Still struggling 🙁

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Index entries laid out differently’ is closed to new replies.
Skip to toolbar