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.

Giving specific category posts its own permalink structure returns 404

First off, the add_rewrite_rule() syntax is add_rewrite_rule( ‘RegEx pattern’, ‘WordPress query string/vars’, ‘position/priority – top or bottom’ ). Now I could see you’re trying to have the following permalink structure: Structure: example.com/foodguide/<post ID>/<post slug> Example: example.com/foodguide/1/sample-food-guide But your rewrite rule (the second one in your code) does not have the proper RegEx subpattern for the … Read more

change pagination url

You may use the format argument of wp_link_pages function like this: <?php $args = array( ‘base’ => ‘%_%’, ‘format’ => ‘?page=%#%’, ‘total’ => 1, ‘current’ => 0, ‘show_all’ => False, ‘end_size’ => 1, ‘mid_size’ => 2, ‘prev_next’ => True, ‘prev_text’ => __(‘« Previous’), ‘next_text’ => __(‘Next »’), ‘type’ => ‘plain’, ‘add_args’ => False, ‘add_fragment’ => … Read more

Incorrect page shown

You can change the general settings URL if you have access to the database by executing the SQL statement: UPDATE wp_options SET option_value = replace(option_value, ‘http://www.oldurl’, ‘http://www.newurl’) WHERE option_name=”home” OR option_name=”siteurl”; ‘http://www.oldurl‘ — Change this to the URL you set in general settings ‘http://www.newurl‘ — Change this to what you want the URL to be

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