flexible rewrite ‘ramble’ URLs with WordPress

You shouldn’t use the htaccess instead you should use the WordPress APIs e.g. function custom_rewrite( $wp_rewrite ) { $feed_rules = array( ‘archives/(\d+)(?:/.*)+’ => ‘index.php?p=’. $wp_rewrite->preg_index(1) ); // ( array merge must be done this way, to ensure new rule comes first ) $wp_rewrite->rules = $feed_rules + $wp_rewrite->rules; } // refresh/flush permalinks in the dashboard if … Read more

404 on category.php pagination

Thanks to this and this i was able to adapt the solution to my problem. Solution: add_action( ‘init’, ‘wpa58471_category_base’ ); function wpa58471_category_base() { add_rewrite_rule( ‘blog/([^/]+)/page/(\d+)/?$’, ‘index.php?category_name=$matches[1]&paged=$matches[2]’, ‘top’ ); add_rewrite_rule( ‘blog/([^/]+)/(feed|rdf|rss|rss2|atom)/?$’, ‘index.php?category_name=$matches[1]&feed=$matches[2]’, ‘top’ ); }

Performance and styles not working fine after changing permalink structure

Your .htaccess should not be modified on the WordPress part, so it should always be: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress It looks like if you have your WordPress install in a Subdirectory of … Read more

Change link to other post to shortlink in the editor

The links in that dialog are made by wp_ajax_wp_link_ajax() (see wp-admin/includes/ajax-actions.php, there is no page on Codex or queryposts.com for that function). To change the links filter ‘page_link’, ‘post_type_link’, ‘post_link’ and maybe ‘attachment_link’ after check_ajax_referer() was called for the action ‘internal-linking’. Okay, sounds a little bit complicated, but it is really easy. 🙂 Plugin on … Read more

Custom Rewrite with Query vars

Add a rewrite endpoint instead of a rewrite rule and query var. This API function will do both of these things for you. function wpd_add_my_endpoint(){ add_rewrite_endpoint( ‘information’, EP_PAGES ); } add_action( ‘init’, ‘wpd_add_my_endpoint’ ); Now any page can have information appended to the end, and the value will be available via get_query_var(‘information’).

Non-Latin Characters in permalinks

You must go about the language functions-interface. See my example for german users: http://wordpress-buch.bueltge.de/wp-content/uploads/2010/05/de_DE.phps We must also build differences on the permalinks for aour charachters in our language /* define it global */ $umlaut_chars[‘in’] = array( chr(196), chr(228), chr(214), chr(246), chr(220), chr(252), chr(223) ); $umlaut_chars[‘ecto’] = array( ‘Ä’, ‘ä’, ‘Ö’, ‘ö’, ‘Ü’, ‘ü’, ‘ß’ ); … Read more

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