Point 404 pages to homepage

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

How to change search page url so that it still returns a page when there’s no search query specified?

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

WordPress is adding “category” word before my actual category name in url (and this is unsolicited)

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

How to add dot(“.”) in post slug

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

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