Pagination issues when using switch_to_blog
-
I have a multisite with 10 blogs using sitewide tags. Blog 10 is the repository for all posts and is never seen. I don’t want to use the main blog for the repository so I am making custom changes to category.php so that it calls all posts from all blogs matching that cat.
The posts display fine, but the pagination fails (404). I use similar code as below on index.php with switch_to_blog and it pages just fine.
As you will see I am rewriting the links for older and newer posts just as in index.php which switches to blog 10 for many things.
The pagination works fine if I replace the “tags” with “blog” BUT this ends up pointing to blog 10 which I do not want. I am only posting after trying many things and need a separate set of eyes. Thanks in advance.
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
- The topic ‘Pagination issues when using switch_to_blog’ is closed to new replies.