Why is a rewrite rule in wordpress prevent pagination?

I changed: add_rewrite_rule(‘^brand-list/([^/]*)/([^/]*)/page/([0-9]+)?’,’index.php?pagename=brand-list&brand=$matches[1]&section=$matches[2]&paged=$matches[3]’,’top’); to: add_rewrite_rule(‘^brand-list/([^/]*)/([^/]*)/page/?([0-9]{1,})/?$’,’index.php?pagename=brand-list&brand=$matches[1]&section=$matches[2]&paged=$matches[3]’,’top’); Note the difference is /page/([0-9]+)? is now /page/?([0-9]{1,})/?$ seems to be working now.

Passing value as hidden parameter to next page

Simply use a $_POST variable to set the terms to the page that handle the recomendations and use an hook into pre_get_posts to set the query. I write a function that output the link, and you can use it as a template tag. Add this function in a plugin or in your functions.php function more_recomentation_link() … Read more

Why isn’t my rewrite rule working when there is no second parameter?

Your regular expression is requiring the last slash be present which it will not be by default. So the path tides/mylocation/ is shortened to tides/mylocation and then tested. Instead, wrap the last part in an optional group using the ? and update the match number. add_rewrite_rule(‘tides/([^/]+)(/([^/]+))?’, ‘index.php?page_id=4348&location=$matches[1]&month=$matches[3]’, ‘top’);

add_rewrite_rule to search

That’s going to the non wp rules because you’re not mapping the URL to the index.php page format. If you want it to be a WP rule, then you need to start the destination with index.php and include the query string to define what you want the query to contain. So if you wanted it … Read more

Add Custom Values to Permalinks Through Custom Fields and Posts

I fixed this issue by adding a rewrite rule to my functions.php file at the top: function melon_rewrites($rules) { $new_rules = array( ‘parties/([^/]*)/([^/]*)$’ => ‘index.php?melon-parties=$matches[2]’ ); $rules = $new_rules + $rules; return $rules; } add_filter(‘rewrite_rules_array’, ‘melon_rewrites’); I then changed my cpt to allow a query_var: function register_custom_post_types() { $args = array( ‘labels’ => array( ‘name’ … Read more