How to make WordPress urls matching static html urls

It looks like every “old” URL is a bit different from each other so you should manually create permanent redirects (HTTP 301) for each URL. I recommend using either Redirects (very simple and intuitive) or Safe Redirect Manager (more advanced features) plugins.

Blog post – single.php url

This is normal. You probably have your Permalinks set to “Post Name”. You can change your Permalinks to “Custom Structure” and put ‘/news’ in there before the post title, so the “Custom Structure” field would look like this: /news/%postname%/ That should do it.

Wrapping add_query_arg with esc_url not working

And the strange part: both codes echo the same string for $url!!! No, they don’t. Look at the page source. esc_url() is encoding the & control character. You can’t do that and expect the HTTP request to work correctly. Use esc_url_raw() instead. Note the description in the Codex concerning that function: The esc_url_raw() function is … Read more

Use wp_redirect to add a parameter

Use add_query_arg to make sure the url is created the right way. How is the wishlist link outputted? Trough wp_nav_menu? I would add it to the link on creation, so you don”t have to use wp_redirect.

Rewrite Most WordPress URLs

I think htaccess would be fastest way. Overhead of checking 50 simple regexp is very small – page generation is several orders of magnitude slower so you shouldn’t care about it. This wont hit performance, you can set rewrite only for domain mysite.com and it won’t check rules for tech.mysite.com reducing overhead, which isn’t noticeable … Read more

get_template_directory() returns wrong address on VPS

You can read data on your server with file_get_contents(). If you want to make sure the file exists and is readable then use is_readable(). You don’t really need to use trailingslashit() in this case because you’re constructing the URI yourself. // path to file under current theme $json_file = get_template_directory() . ‘/inc/includes/acf-fonticonpicker/icons/selection.json’; // make sure … Read more

Pass form input via url variable

The first form: <form method=”post” action=”some-url.php”> <input type=”email” placeholder=”Email address” value=”” name=”email”> <input type=”submit” value=”Submit” name=”email-submit”> </form> Then in some-url.php: if( isset($_POST[’email’] ) $email = $_POST[’email’] The post method would be preferred here since it won’t create server log entries that include the user’s email address. You should also do this over SSL since you … Read more

DNS – Change WordPress Site Name?

You need to update all the places in the database that are using the original location. you can use the following tool to do so. There are others but I have found this one to be easy. Just remember to remove the files after you are done with it. I would run this in it’s … Read more

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