[ajax] previous/next posts always (5 posts)

  1. xanuex
    Posted 7 years ago #

    Hey folks,

    In my template the previous 5 posts are shown (from the active post on) just with a title, date and category.

    What I would like is that people can always navigate through these posts by pressing 'previous posts' and 'next posts', even when a post with comments is active (this is the hard part...)

    What would be even better... is when this all happens without refreshing the entire page.

    Is there anyone who knows a plugin for this OR... can help with the code so I can post it in my template?

    thanks in advance!
    - Marcel

  2. xanuex
    Posted 7 years ago #

    --gentle kick--

  3. Creedo
    Posted 7 years ago #

    Well, I dont know, but you've perked my interest. I spent a few minutes googling it and came across this:


    I don't know if this will help you at all, I haven't looked into it deeply yet. I just scanned the features, maybe it'll give you somewhere to start?

  4. xanuex
    Posted 7 years ago #

    At least I could interest someone else with my post :P

    I already have the plugin installed, although the plugin has many features (and maybe even the one I am looking for) it stays an overall plugin. I think I'm more looking for a specific solution for my problem.

    this is the code I am using right now

    <h2>Previous Entries</h2>
    <ul class="block">
      $myposts = get_posts('numberposts=5&offset='.$paged);
      foreach ($myposts as $post) :
        foreach (get_the_category() as $category)
          $categories[] = $category->cat_name;
      <li><a href="<?php the_permalink();?>"><span><?php the_title(); ?></span><em><?php the_date();?> in <?=implode(", ",$categories);?></em></a></li>
    <?php endforeach;?>
    <span class="prev_entry"><?php next_posts_link('&laquo; Previous Entries') ?></span>
    <span class="next_entry"><?php previous_posts_link('Next Entries &raquo;') ?></span>

    I think I need to change the type of function used for showing 'next/previous'-post to one of my own which just effects the above code but I actually don't really know how :)

    So if there is someone who can give me some strong hints I would be very glad!

  5. incite
    Posted 6 years ago #

    Found a solution to this yet? Im looking for exactly the same thing :S

Topic Closed

This topic has been closed to new replies.

About this Topic