WordPress how to prevent URL encoding in URL of taxonomy terms
WordPress how to prevent URL encoding in URL of taxonomy terms
WordPress how to prevent URL encoding in URL of taxonomy terms
You shouldn’t need to manually handle this with hooks & custom slug settings – just ensure hierarchical is set to true in your register_post_type arguments. You mention “CPT UI” settings, are you referring to the Custom Post Type UI plugin? If so, make sure Hierarchical is set to True in the Settings metabox.
Make the home page’s slug visible in the browser’s URL bar
How to change an existing wordpress page rewrite rule?
How to transform multiple parameter URL to clean URL
You can use the template_redirect action to add /search/ to your search URL’s. Check out the code below: function my_change_search_url() { if ( is_search() && ! empty( $_GET[‘s’] ) ) { wp_redirect( home_url( ‘/search/’ ) . urlencode( get_query_var( ‘s’ ) ) ); exit(); } } add_action( ‘template_redirect’, ‘my_change_search_url’ );
You need to set the rewrite parameter with_front to false inside your post type registration. ‘rewrite’ => array( ‘slug’ => your-posttype-slug, ‘with_front’ => false ), See the rewrite parameter on the register_post_type codex page.
Changing the rewrite rules does not affect how WordPress writes links (except for the standard links, to posts, archives, … and then only in simple cases). The rewrite rules only cover how incoming URLs are handled, you are responsible for writing the links in the new format. This is different from frameworks with more advanced … Read more
Just remove pagename=event& and reset your rewrite rules… $newRule = array(‘event/(.+)’ => ‘index.php?eventid=’.$wp_rewrite->preg_index(1)); *template_include* is a filter NOT an action! add_filter(‘template_include’, array($EventpageCode, ‘template_redirect_intercept’)); You can use *wp_title* function or filter to modify your page title.
Where are you trying to do the force redirect? I think the best place for this may be in a .htaccess file. Something like RewriteEngine on RewriteCond %{HTTP_HOST} !^www.your_domain.com$ RewriteRule ^(.*)$ http://www.your_domain.com/$1 [R=301]