Support » Fixing WordPress » How to add line between recent posts?

  • Below is the code from my sidebar.php file that displays recent posts. I think if I change the number 12 to say, 6, I can reduce the number of posts shown.

    What would I need to do to add a line between each post listing? As it is now, some post titles display on two lines, others on one. It would be easier to see the distinction between posts if there was a blank line between each one. Thanks!

    `<h2>Recent</h2>

      <?php get_archives(‘postbypost’,’12’,’custom’,’

    • ‘,’
    • ‘); ?>

Viewing 3 replies - 1 through 3 (of 3 total)
  • You should be using wp_get_archives() instead:

    wp_get_archives('type=postbypost&limit=12&format=custom');

    To add a blank line or anything else, you can use the before and after parameters. Like so:

    wp_get_archives('type=postbypost&limit=12&format=custom&after=<br/>');

    And so on. Just make before and/or after = the html you want to insert there.

    Thanks. This is what I changed it to and it works, except it does not put in the line space. Can you see my mistake?

    `<?phpwp_get_archives(‘type=postbypost&limit=6&format=custom&after=<br/>’);?>

    except it does not put in the line space

    What, exactly, is a “line space”? It’s hard to understand what you want when you use non-standard terms.

    The <br/> adds a line break. Maybe you want it to add two of them? Like <br/><br/> or something? I don’t know what you want until you explain it better.

    Or, it might be easier if you simply gave us a link to the page itself so we can see the results and see what you’re talking about.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to add line between recent posts?’ is closed to new replies.