• Resolved mexxa84

    (@mexxa84)


    I have page that uses a specific page theme to show posts from a specific category.
    I have set to only show 5 at a time. The problem I have is that I cant get any of the “next_posts_link” to work so that you can see the next page of 5 posts.
    I got that “next_posts_link” to work on the category.php but ideally I would like to have it work on that page theme.
    From all my research I think I am either doing something wrong or it’s not possible to use “next_posts_link” on a page.
    Here is my current code without the “next_posts_link”:

    [code moderated - use the pastebin for any code over the forum limit of 10 lines]

    Any help or suggestions would be great. Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter mexxa84

    (@mexxa84)

    If it matters, this is the code I use for the category.php which works:

    [code moderated - use the pastebin for any code over the forum limit of 10 lines]

    The only problem I have with this one is that the subheading doesnt show up on all posts ??

    Thread Starter mexxa84

    (@mexxa84)

    Sorry about. I am using a new set of codes now that now shows the “next page” link except that when it goes to /page/2 its empty/missing.

    <?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("type=post&;paged=$paged"); ?>
    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    ///POST PREVIEW///
    <?php endif; ?>
    <?php posts_nav_link(' | ','&laquo; Newer Articles','Older Articles &raquo;'); ?>

    I took off the post code since that shouldn’t be a factor and keeps me under 10 lines ??

    Thread Starter mexxa84

    (@mexxa84)

    OK, I solved the issue of the missing/empty page.
    I changed the category base to blog which is the same name as the archive page.
    I put the base to default and now the page is not missing.
    I ended up trying blog/topics to keep fluidity and that worked as well.
    ———–
    New problem, the next/previous pages all contain the same post.
    While looking for answers earlier I remember finding some threads about this so hopefully I can get this fixed.
    If you can help me with this tho I would really appreciate it.

    Thread Starter mexxa84

    (@mexxa84)

    Hard for me to understand why this works but it does for me:
    https://weblogtoolscollection.com/archives/2008/04/19/paging-and-custom-wordpress-loops/
    If you are interested in showing posts in your archive page with pages working I recommend the code on the link.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Showing Category Post on a Page.’ is closed to new replies.