How to change url of specific posts with name of a root page
How to change url of specific posts with name of a root page
How to change url of specific posts with name of a root page
EDIT 2: You could also make a function to load your front-page.php template for 404 pages. See below: add_filter(‘template_include’, function($template) { if ( is_404() ) { return locate_template([‘front-page.php’]); } return $template; }); EDIT: I read over the fact that you want to keep the URL as is. Why is that if I may ask? You … Read more
Isn’t that just because you’ve put ! empty( $_GET[‘s’] ) in your IF statement? Is your search page accessible when you remove that part? EDIT: Or maybe change your function to something like this (untested): function wpb_change_search_url() { if ( is_search() ) { if ( isset( $_GET[‘s’] ) ) { wp_redirect( home_url( “/search/” ) . … Read more
Redirect users with “.” (dot) in their username and replace with “-” (dash) to correct profile
Have unique URLs on the ad site
After a lot of research and trying different things, I came across this page https://core.trac.wordpress.org/ticket/50976 which wasn’t exactly the same as my problem, but the cause of this was also what broke my site. To get around this, without having to change my URL structure and therefore get google to reindex all my pages, I … Read more
This should be a comment but I have not enough reputation yet, sorry for that… As Jacob said in his comment this is the normal behaviour. However this issue has already been discussed many times. Check this Q/A as an example: https://stackoverflow.com/questions/17798815/remove-category-tag-base-from-wordpress-url-without-a-plugin
Found the solution, just had to remember all the ? marks. It works when the regex is like this: ‘index.php?catalogs=$matches[1]&p1=$matches[2]&p2=$matches[3]&p3=$matches[4]’
WordPress runs slugs through its sanitize_title_with_dashes() filter function which replaces dots with dashes. Unfortunately the function doesn’t give you any control over that or any ability to change what characters are stripped or replaced. What we can do however is remove that filter and add our own version of it with a couple of modifications: … Read more
add_rewrite_rule() issue with parent/child/child page