Forums

[Plugin: Post Teaser] Will this work in static pages with multiple loops? (1 post)

  1. ldexterldesign
    Member
    Posted 3 weeks ago #

    WP v2.8.5

    ... or am I flogging a dead horse here?

    I can get it working fine on the front page if it's displaying my latest posts, but nowhere else?

    I'm using multiple loops on my homepage and need an excerpt feature for the few category posts I've introduced to the page.

    Insert more tag isn't working for me and neither is the_excerpt() function (I'm guessing because I'm using another loop?).

    From page.php:

    <?php // if homepage; display 2 q&a posts ?>
      <?php if(is_page(25)){
      	$my_query = new WP_Query('cat=3&showposts=2');
    	while ($my_query->have_posts()) : $my_query->the_post(); ?>
      <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
        <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>">
          <?php the_title(); ?>
          </a></h2>
        <small>
        <?php the_time('F jS, Y') ?>
        <!-- by <?php the_author() ?> -->
        </small>
        <div class="entry">
          <?php the_content('Read the rest of this entry &raquo;'); ?>
        </div>
        <p class="postmetadata">
          <?php the_tags('Tags: ', ', ', '<br />'); ?>
          Posted in
          <?php the_category(', ') ?>
          |
          <?php edit_post_link('Edit', '', ' | '); ?>
          <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?>
        </p>
      </div>
      <?php endwhile; } ?>

    Thanks,

    http://wordpress.org/extend/plugins/post-teaser/

Reply

You must log in to post.

About this Topic