1. Go to this page and download the library: Download sectsect/wp-tag-order library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$tag_updater = new \WP_Tag_Order\Tag_Updater();
try {
// Update tag order using an array or comma-separated string
$result = $tag_updater->update_tag_order(
get_the_ID(), // Post ID
'post_tag', // Taxonomy that enabled in plugin settings
[1, 2, 3] // Tag IDs in desired order
);
} catch ( \InvalidArgumentException $e ) {
// Error handling
error_log( $e->getMessage() );
}