Rewrite a category

You cannot use the same term for a category, page, tag as they need to be unique. When you do, you’ll get a number next to the slug To fix them you’ll need to fix the tag or page slug otherwise edit the category slug last http://wordpresssites.net/links/how-to-edit-change-fix-duplicate-category-slugs-in-wordpress/

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

WordPress custom search url

It’s easy. Just add this hook for template_redirect action and it will redirect your search queries to nice url: function wpse8170_search_url_redirect() { if ( is_search() && !empty( $_GET[‘s’] ) ) { wp_redirect( home_url( “/something/” . urlencode( get_query_var( ‘s’ ) ) ) ); exit; } } add_action( ‘template_redirect’, ‘wpse8170_search_url_redirect’ ); Add to your .htaccess file: # … Read more

Custom Post Types, URL rewrite on multiple CPTs

Assuming the code snippet provided works then extending the conditional statement like so will help you, function filter_post_type_link($link, $post) { if ($post->post_type=”custom_post_type_1″) { if ($cats = get_the_terms($post->ID, ‘custom_cat_1’)) $link = str_replace(‘%custom_cat_1%’, array_pop($cats)->slug, $link); return $link; } elseif ($post->post_type=”custom_post_type_2″) { if ($cats = get_the_terms($post->ID, ‘custom_cat_2’)) $link = str_replace(‘%custom_cat_2%’, array_pop($cats)->slug, $link); return $link; } else { return … Read more

Request parameters in $_GET do not match URL called

WordPress will typically filter off query arguments unless you tell it about those arguments and ask it not to. From this older tutorial, you can see how to add a new query variable to WordPress (so it won’t get stripped out): add_filter(‘query_vars’, ‘parameter_queryvars’ ); function parameter_queryvars( $qvars ) { $qvars[] = ‘myvar’; return $qvars; } … Read more

Updating URLs in many posts

Use the script found here: https://interconnectit.com/products/search-and-replace-for-wordpress-databases/ Because WordPress serializes some urls in option and meta tables a simple replace won’t do. A siple replace will break your data. This script will preserve your data and replace it with a new url. I use it al least twice a month.

How to allow — in category name

The — to an mdash conversion happens inside wptexturize() http://codex.wordpress.org/Function_Reference/wptexturize which is applied to many things (including taxonomy titles and other functions output. Look for places you might want to remove the filter from in wp-includes/default-filters.php and remove the filter with the remove_filter() function: http://codex.wordpress.org/Function_Reference/remove_filter

How do I link to a blog not set as the homepage?

The permalinks by default are output relative to the site’s blog posts index (aka ‘page-for-posts’, aka posts page). You’re using a custom page template for the static page Section/News. That static page is unrelated to the site blog posts index. That’s why the permalinks don’t reference that page. If you want your permalinks to reference … Read more