WordPress Developer Ukraine, Kyiv
WP_Query Loop: Incorrect Sort Order with AJAX Filters

WP_Query Loop: Incorrect Sort Order with AJAX Filters

WP_Query loop: incorrect sort order with AJAX filters A custom loop with AJAX filters sorted posts correctly for one post type and incorrectly for another. The query arguments were the same, which was a mystery at first. The culprit turned out to be a plugin that changes the order of posts for the post types…
How to Get User Location by IP Address in WordPress

How to Get User Location by IP Address in WordPress

How to get a user’s location by IP address in WordPress Geolocation lets you show or hide content depending on the visitor’s country: region-restricted products, localised promotions, country-specific notices. The approach has three steps: get the visitor’s IP, ask a geolocation service which country it belongs to, and act on the result.
How to Translate a WordPress Theme or Plugin

How to Translate a WordPress Theme or Plugin

How to translate a WordPress theme or plugin WordPress has a built-in localisation system based on GNU gettext. The workflow: wrap translatable strings in translation functions, generate a .pot template, create a .po file for each language, compile it to a binary .mo file, and load the text domain in your theme or plugin.