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

Is the SEO plugin necessary?

The main purpose of SEO plugin is to give you more control over SEO-related factors (titles, excerpts, meta tags and so on). It doesn’t do anything magical, just an editor to let you fine-tune beyond native WP capabilities. So necessity equals if and how much of those aspects you are willing to spend time on. … Read more

Rewrite Rules for Multiple (more than 2) Taxonomies

You could try something like this: function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘product-category/(.+)/material/(.+)/color/(.+)’ => ‘index.php?product_cat=”. $wp_rewrite->preg_index(1).”&pa_material=”. $wp_rewrite->preg_index(2).”&pa_color=”. $wp_rewrite->preg_index(3) “product-category/(.+)/color/(.+)’ => ‘index.php?product_cat=”. $wp_rewrite->preg_index(1).”&pa_color=”. $wp_rewrite->preg_index(2) “product-category/(.+)/material/(.+)’ => ‘index.php?product_cat=”. $wp_rewrite->preg_index(1).”&pa_material=”. $wp_rewrite->preg_index(2) ); $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules; } // refresh/flush permalinks in the dashboard if this is changed in any way add_filter( “generate_rewrite_rules’, ‘custom_rewrite’ ); It … Read more

How-to add rewrite rules to point the uploads folder to a subdomain

If you are not willing to filter only image uploads, i.e., all uploaded media will reside in the same folder/subdomain, then there’s a simple configuration solution: go to options-media.php set the Store uploads option to wp-content/uploads set the Full URL option to http://uploads.yourdomain.com create a subdomain making the uploads folder be http://uploads.yourdomain.com

External/non-WP rewrite rules

Here are some notes. Install Toschos rewrite plugin Install Jan Fabrys rewrite analyzer plugin. Use the Rewrite API Add your rules to top. There’s also the function add_external_rule(), which should be accessible via $GLOBALS[‘wp_rewrite’]->add_external_rule(); All your external rules are accessible via $wp_rewrite->non_wp_rules. Here’re the internals, that show you how the rules get added inside $wp_rewrite->mod_rewrite_rules(): … Read more

Clash of the rewrites

Your best option is to register neighborhoods as a custom taxonomy and use that instead of categories. In your theme’s functions.php file, you just need to add: function neighborhoods_init() { // create a new taxonomy register_taxonomy( ‘neighborhoods’, ‘post’, array( ‘label’ => __( ‘Neighborhoods’ ), ‘hierarchical’ => true ) ); } add_action( ‘init’, ‘neighborhoods_init’ ); Next, … Read more

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