Custom permalink structure with a prefix just for posts

There are different ways to achieve this result, I used pre_post_link and post_rewrite_rules filter hooks. You can use eg. generate_rewrite_rules hook, but with post_rewrite_rules, you can easily change permalinks not only to the post but also to its comments, attachments, etc. Original permalinks you can keep or replace with new ones. After adding the following … Read more

Changing link format from Calendar widget

The calendar widget doesn’t link to “each day’s post”. It’s linking to an archive page that lists all posts made on that date. Hence the /2019/08/01/ URL. If you click the post title (or “Continue Reading” or “Read More” link if there is one) you will be taken to the single post whose URL will … Read more

Extra url paths as variable

The correct way to register the rewrite rule and rewrite tag for your case is: function custom_rewrite_rules() { add_rewrite_tag(‘%nights%’, ‘([^&]+)’); add_rewrite_tag(‘%people%’, ‘([^&]+)’); add_rewrite_rule(‘house/(.+)/(.+)/(.+)/?$’, ‘index.php?house=$matches[1]&nights=$matches[2]&people=$matches[3]’, ‘top’); } add_action(‘init’, ‘custom_rewrite_tag’, 10, 0); The code has been tested and works correctly.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)