WordPress Multisite Database Structure

Pagination for Custom Loops

There are different ways to create a pagination for WordPress posts in a loop:

  • Using next_posts_link() and previous_posts_links() functions
  • Using paginate_links() or get_the_posts_pagination() that allows to display numeric pagination.
  • In old times we also used plugins for that purpose, the most popular was WP-Pagenavi.

In this tutorial my goal is to show you how to create any kind of custom paginations for almost anything. For example did you know that do display page numbers in Appearance > Menus is also used paginate_links() function?

custom pagination in WordPress nav menus

How to Search across All Sites in WordPress Multisite Network

Step by step tutorial about creating global search in your Multisite Network.

WordPress Multisite: How to Get all Terms in a One Loop

In this tutorial I am going to talk about how to print all the terms from your multisite network using just one query. It means that we are not going to use swith_to_blog() solution, because there is some disadvantages to it.

  • When you print categories or any other custom taxonomies with the help of switch_to_blog() and get_terms() it will be tough to sort them in a desired way, and usually terms are going to be displayed separated by a site (all terms from Site 1, then all terms from Site 2 etc).
  • There are going to be a lot of SQL queries – for each loop iteration at least.