Automatic short URL in posts

I installed yourls on a custom short domain. Then added an acf field to posts. Then when a post is added or modified, call yourls API to get the shortlink, and save that link in the custom field add_action(‘acf/save_post’, ‘update_related_posts’, 20); function update_related_posts($post_id) { global $old_field_value; // Check if the save is an auto-save, in … Read more

why same category base and single post base don’t work?

When you set WordPress up with: The set-up Custom Permalink Structure: /blog/%postname%/ Category base: blog Generated rewrite rules WordPress generates these rewrite rules: blog/([^/]+)(?:/([0-9]+))?/?$ => index.php?name=$matches[1]&page=$matches[2] blog/(.+?)/?$ => index.php?category_name=$matches[1] Rewrite rule position in the rewrite_rules_array Your post rewrite rule (#1) is positioned earlier (therefore higher priority) than the category rewrite rule (#2) in your rewrite_rules_array. … Read more