WordPress – Page 12

10 Ways to Get Post ID

I decided to create this super-detailed tutorial so it would never be a problem for you to find out any post ID. When I say “post ID” I also mean pages, custom post types and WooCommerce products and orders.

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 Create AJAX Filters

In this tutorial I am going to guide you step by step through the process of creating WordPress AJAX filters and I am about to show you two examples – at the first one we will create a simple post filter by category and in the second example we will dive deep into WP_Query in order to create a complex search filter with a couple of custom fields.

In our examples we’re also going to use:

  • 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 by default, there is no real reason to use it.
  • A default “Twenty Twenty” WordPress theme. We can not use latest themes like Twenty Twenty-Four, because the latest themes are block themes and in that case we will need to create a Gutenberg block for our filter which is a completely different story. By the way, if you’re interested in such a block, please let me know in the comments below.

Let’s get straight to the AJAX filter examples now.

How to Use Image Uploader in WordPress Admin Area

In this tutorial I am going to dive deep in WordPress media uploader functionality. By the way it is possible to implement not for only images but for any supported file types.

This is how it looks in WordPress admin area:

Image uploader field in WordPress option pages
Below in this tutorial I will also describe how to create a settings page like this.

Mailchimp API in WordPress

In this tutorial we are going to talk deeply about establishing connection with Mailchimp API using WordPress HTTP API functions.

In our code examples we are going to use wp_remote_get(), wp_remote_post() and wp_remote_request() functions. If you’re looking for cURL examples, here is another tutorial.

How to Sync WordPress User Registrations to Mailchimp

In this tutorial I will show you two different ways how you can sync WordPress user registrations to Mailchimp. The first way is more for developers, we are going to create API requests, the second one – for regular users, so all you have to do is just to install the plugin.

wp_schedule_single_event() – all about scheduling one-time events with working examples

With this function I open the new post series about WordPress Cron. I don’t want to create the common post about all the cron functions, so we will look at each function separately.