Forums

recent posts help? (2 posts)

  1. ruick
    Member
    Posted 4 years ago #

    hey i got this code

    <?php if (is_single()) : ?>

  2. recent entries:
      <?php $latest = new WP_Query('showposts=5');
      while ($latest->have_posts()) : $latest->the_post(); ?>
      <?php
      $title = get_the_title();
      if (strlen($title) >= 35)
      $title = substr($title, 0, 35) . '…';
      ?>

    • "><?php echo $title; ?>
    • <?php endwhile; ?>

  3. <?php endif; ?>

    and i put it on my temporary site http://www.kupuj-taniej.com/absorbdesigns/

    and the recent posts only show up when you click on individual blogs. how do i make it show up on the homepage, and on every single page? this is in my side bar btw.

  • oriecat
    Member
    Posted 4 years ago #

    Delete the first and last line. is_single is telling it to only display when using single.php, which is only used on single post views.

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.