Article written

  • on 28.06.2009
  • at 07:13 PM
  • by ltp

Alternate Recent Posts: Small code fix for the list that is output 1

Jun28

I’ve been using Alternate Recent Posts for about 2 hrs now and ran into one small issue with the code.

I noticed that basically how the plugin works is that is loops through posts, compares and then skips the ones that are on the post loop for the page already. In the code, there was a spot where the post determines if it’s going to actually output anything for each post it checks.

Line 88 (all this should be on one line):

<li><a href="<?php the_permalink() ?>"><?php
    if ( get_the_title() ) the_title();
    else the_ID(); $postcount++; endif; ?> </a></li>

Just change that to this:

<li><a href="<?php the_permalink() ?>"><?php
    if ( get_the_title() ) the_title();
    else the_ID(); $postcount++;
    ?></a></li><?php endif; ?>

… and you won’t have any hanging html tags.

Related posts:

  1. Alternate Recent Posts: A clever, simple & useful Wordpress plugin:
  2. Failed blog posts

subscribe to comments RSS

There is one comment for this post

  1. GeekLad says:

    Many thanks for this fix! I’ve updated v0.3 to include it.

Please, feel free to post your own comment

* these are required fields

Web Guy 303 is powered by WordPress and FREEmium Theme.
developed by Dariusz Siedlecki and brought to you by FreebiesDock.com