Append country to ‘pretty’ url but serve same page

If you are needing one rewrite rule for that single page, this snippet should get you there. You’ll need to replace the XXXX in that snippet to be your post ID of your signup page. function signup_pg_rewrite_rule() { add_rewrite_rule(‘^signup/([^/]*)/?’,’index.php?page_id=XXXX&country_code=$matches[1]’,’top’); } add_action(‘init’, ‘signup_pg_rewrite_rule’, 10, 0); After you drop this in, you’ll need to flush that rewrite … Read more

CPT Archive with core Category

You want display posts of a given type ({post_type}) from category ({term}) and structure of link should looks like this: {post_type} / category / {term} To avoid collisions with links to pages and “blog” posts, expression can not start with ([^/]+), but should contain slug of post type entered explicitly. This means a separate rule … Read more

Can’t change first part of URL rewrite for custom post type

The problem is with that add_rewrite_tag(‘%keyterms%’, ‘(.*)’), which results in rewrite conflicts because the generated rewrite rules would match http://example.com/(anything-here) and that (anything-here) can be a Page (post type page) slug, hence http://example.com/page-slug would not work — you wouldn’t get a 404 error page, but the proper Page wouldn’t be displayed, either. So looking at … Read more

NextGEN Gallery Lightbox – Social Share URL Redirect

You could do something like the following in .htaccess before the existing WordPress directives. RewriteCond %{QUERY_STRING} ^uri=(/[^&]+) RewriteRule ^nextgen-share/(\d+/\d+)/full$ %1#gallery/$1 [QSD,NE,R,L] The RewriteRule pattern only matches against the URL-path, so you need the preceding RewriteCond directive in order to match the query string portion of the URL. If the /121212/8989/ part always consists of 6 … Read more

How to overwrite registered taxonomy url from vendor plugin in child theme

You don’t need those custom rewrites and term permalink tweaks, so just remove these and the relevant callbacks: add_action(‘init’,’theme_child_custom_rewrite’, 1000); add_filter( ‘term_link’, ‘listing_region_term_link’, 1, 3 ); And just use the register_taxonomy_args hook to override the taxonomy’s parameters: function override_listing_region_taxonomy_args( $args, $taxonomy ) { if ( ‘listing-region’ === $taxonomy ) { $args[‘rewrite’] = array( ‘slug’ => … Read more