Forums

Display posts on page with pagination (10 posts)

  1. mYrAn
    Member
    Posted 1 year ago #

    Hello!
    I use a page to display posts from 3 sub-cats. But right now i cant get pagination to work, it just sends me to the next post and not a new page showing posts.. This is my code:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    So how can i get a working pagination here? i just want it to grab from the categories in the query. Thanks in advance!

    Edit: I just realized that if this could show sub-categories and not just the category-catname.php that would also work for me.

  2. mYrAn
    Member
    Posted 1 year ago #

    http://pastebin.com/FMM6rQAY

    Since i couldn't have in the post :<

  3. keesiemeijer
    moderator
    Posted 1 year ago #

    try it with this: http://pastebin.com/AZ5zdcja

  4. mYrAn
    Member
    Posted 1 year ago #

    You missed a commasign, otherwise it worked fine :) But right know it displays both the prev and next even if there isn't a prev or next :< is there a way to get around this?

  5. keesiemeijer
    moderator
    Posted 1 year ago #

    This is not normal behavior, can we have a link to this page? Maybe resaving your permalink structure under Settings > Permalinks will do the trick.

  6. mYrAn
    Member
    Posted 1 year ago #

    Nevermind that, i had forgetten to remove a bit of code when i modified the buttons :< A new question comes to mind tough. I have a category named "blog", and the page im doing all this is called "blog". So they have the same permalink (blog). But this causes a problem with the pagination, it gets a 404 now :< Is there a way to go around this? So it doesnt try to do it in the category blog, but in the page blog. The reason i have it like this is that when i go to mysite.com/blog, it displays all posts (without pagination before), and when you click a post its still mysite.com/blog/postname, and not mysite.com/othercatname/postname..

    Edit: If i change the link the anchor for the next-page-button from mysite.com/blog/page/2 to mysite.com/blog/2 it works. I recon this is the easiest fix, but is there a way to do it?

  7. keesiemeijer
    moderator
    Posted 1 year ago #

    What is your permalink structure?
    If you click a post doesn't it go to example.com/postname ?

  8. mYrAn
    Member
    Posted 1 year ago #

    %category%/%postname% with category base removed(no 'category' infront of categoryname)! Read the edit in the last post.

  9. keesiemeijer
    moderator
    Posted 1 year ago #

    If you have %category% as the first part of the structure and a category and page with the same title there will be apermalink conflict. There's no easy way to do what you want. Maybe you can use custom taxonomies to structure the site the way you want

  10. mYrAn
    Member
    Posted 1 year ago #

    damn.. Is there really no easy way to just change the link from page/2 to /2 :<?
    Edit: Just a thought, wouldn't jquerys replace function be able to remove the 'page' part from the link :o?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.