Non latin post slug truncate

No, it is not entirely possible. WordPress is using Percent encoding to sanitise the slug. You could undo this, and it would deliver nonlatin characters, but the browser would immediately swap these out for percent encoded characters when you tried to visit the page. Wether your database will store these characters, and the table encoding … Read more

Rewrite rule for a query string

Try this code: function geotags_add_rewrite_rules($wp_rewrite_rules) { global $wp_rewrite; $rule_key = ‘%cityid%’; $url_pattern = ‘([^/]+)’; $query_string = ‘cityid=’; $wp_rewrite->add_rewrite_tag($rule_key, $url_pattern, $query_string); $url_structure = $wp_rewrite->root . “cityid/$rule_key/”; $rewrite_rules = $wp_rewrite->generate_rewrite_rules($url_structure); $wp_rewrite_rules = $rewrite_rules + $wp_rewrite_rules; return $wp_rewrite_rules; } add_filter(‘rewrite_rules_array’, ‘geotags_add_rewrite_rules’); function geotags_add_query_var($query_vars) { array_push($query_vars, ‘cityid’); return $query_vars; } add_filter(‘query_vars’,’geotags_add_query_var’); NOTE: Remember to save permalinks so your new … Read more

Moving local wordpress page to a real server subdomain broke my permalinks?

You have to change other URLs in the database, not just in the wp_options tables. Use these queries in phpmyadmin to change post links and metadata within post and page content: UPDATE wp_posts SET guid = replace(guid, ‘http://www.olddomain.com/’,’http://www.newdomain.com/’); UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.olddomain.com/’, ‘http://www.newdomain.com/’); UPDATE wp_postmeta SET meta_value = replace(meta_value, ‘http://www.olddomain.com/’, ‘http://www.newdomain.com/’); Reset … Read more

How to redirect to correct pages after permalink structure change

WordPress should handle all redirections correctly, without you needing to worry about them. For example, if your old post was http://example.com/2012/10/11/i-like-stackexchange any links should auto-magically be redirected to http://example.com/favorite-things/i-like-stackexchange. I just tested it on a site with WordPress 3.4 installed, and it worked just fine. WordPress can read your mind.

Include Post Format in permalink

While researching this topic myself, I found a plugin called Post Format Permalink. However, this plugin is not compatible with recent versions of WordPress; it is also filled with unnecessary code. I forked the plugin’s repository on GitHub, and improved the code greatly. I can now use a %post_format% tag in my permalink structure, and … Read more

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