How to Use Select2 Multiselect in Meta Boxes
In this tutorial, I will show you two examples of how to use Select2 when creating custom fields in WordPress admin. Particularly, I will show you how to do it in meta boxes in the classic editor, but you can do the same for taxonomy settings or options pages.
In the first example, we will use Select2 to create a multiselect dropdown with tags. In the second one, it will become more interesting; we will do the same for posts, but also with an AJAX search (both examples will also be implemented in two ways – programmatically and with my Simple Fields plugin).
Simple Load More Block
With the help of this plugin you can easily create an AJAX load more button on your WordPress website (or WooCommerce store) or just auto load posts on scroll.
Load More Products in WooCommerce
In this tutorial, I will uncover two ways how you can load more products with AJAX on your WooCommerce store’s pages.
- Firstly, I will show you can do it in classic WooCommerce themes, for example, Storefront.
- Then, we will do it for a block theme.
As a bonus, we will take a look at how to create an infinite scroll for WooCommerce products.
Load More Posts with AJAX. Step by Step Tutorial. Without Plugins
In this tutorial, I am going to show you how you can implement asynchronous post loading in WordPress or even an infinite scroll.
Please consider that there could be two different implementations for the AJAX load more button and it depends on the theme you’re using today. For example:
- If you’re using old-fashioned themes, then you can create a load more button with a little bit of PHP and JavaScript code (and that’s exactly what we’re going to do in this tutorial).
- If you’re using block themes (FSE themes), then the whole implementation comes down to a custom block which will represent our load more button. I am going to talk about it as well.
No matter which way you choose, upgrading your AJAX load more button into an infinite scroll is not a big deal, by the way.
Load More Comments via AJAX
In this tutorial, we will discuss different ways of how you can create paginated comments in WordPress, in every of the mentioned ways we’re going to use AJAX (it means, that the comments pagination, load more button, or infinite scroll will work without page refresh).
How to Create a WooCommerce Product Filter by Category
We’re going to take a look at two ways how you can build a WooCommerce category filter on your store. Both ways are going to be fully AJAX (without page refresh). The first one is intended for stores that use classic WordPress themes, for example, the Storefront theme, and the second is for block themes.
It is interesting to note that at the moment of writing this tutorial, it is impossible to create a WooCommerce category filter using just standard WooCommerce settings and blocks (and it doesn’t matter whether it is a classic or block theme).
How to Create an AJAX Category Filter without Plugins
In this tutorial, I am going to dive deep into the process of creating an AJAX category filter for a WordPress website. We will not use any plugins for that, but if you change your mind and decide to use a plugin after all, I recommend you look at this one.
In our example we’re also going to use the following:
- Pure JavaScript on the front end. I know, many of you guys don’t like jQuery and since it is not a filter for a WooCommerce store and the library isn’t included in the front-end anyway, there is no real reason to use it.
- A default “Twenty Twenty” WordPress theme. We can not use the latest themes like Twenty Twenty-Four or Twenty Twenty-Five, because the latest themes are block themes and in that case, we will need to create a Gutenberg block for our AJAX category filter which is a completely different story. Currently, I don’t have a tutorial for that, but if you need a category filter for a WordPress block theme, please check my taxonomy filter block plugin.
Below is the preview of how our AJAX category filter is going to look like:
