How does: /index.php?post_type=event&event-date=2011-07-25 work? What if it doesn’t work?

You will have to use the rewrite API to get that to work. First you need to register the rewrite rule. add_action( ‘init’, ‘wpse23712_rewrites’ ); function wpse23712_rewrites() { add_rewrite_rule( ‘events/day/(\d{4}-\d{2}-\d{2})/’, ‘index.php?post_type=event&event_date=$matches[1]’, ‘top’ ); } Then add your event_date to the query vars so wordpress understands it. add_filter( ‘query_vars’, ‘wpse23712_vars’ ); function wpse23712_vars ( $vars ) … Read more

Flushing rewrite rules

What flush_rewrite_rules(); does is call $wp_rewrite->flush_rules(); (Also called when updating permalinks). All plugins rewrite rules are regenerated then, so you dont need to worry about other plugins rules being “missing”. Also is not a good idea to call this function (flush_rewrite_rule) on hooks that run each time wordpress is loaded, and is enough to call … Read more

Clicks registering on Preview DNS site

It appears that you have content (pages, posts or widgets) that contain old URL information. An example of a URL that is correct: http://www.hutchisonhaines.co.uk/wp-content/themes/FactoryWP/style.css An example of a URL that is incorrect: http://hutchisonhaines.co.uk.previewdns.com/wp-content/uploads/2012/02/flowers-944×290.jpg The quickest way to fix this problem would be to do a database dump and then run a search and replace program … Read more

How to get CGI variables?

First off, these aren’t CGI variables, they’re query string arguments. WordPress, by default, will remove any query arguments that it doesn’t recognize. So you need to register them with WordPress and then pull them back out of the query. First, add your new query variable: function wpa_48528_vars( $vars ) { $vars[] = ‘filter’; return $vars; … Read more

Problem with parent page slug only in WordPress admin

Edit. Here’s another solution to not mess with the edit slug button. The function get_sample_permalink_html in wp_admin/includes/post.php outputs the sample permalink and an edit button. It can be filtered like this: add_filter(‘get_sample_permalink_html’,’my_sample_permalink’,10,2); function my_sample_permalink ($page_link,$id){ $page = get_page($id); if($page->post_type == “page” && $page->post_parent) { $parent = get_page($page->post_parent); $page_link = preg_replace(“/(sample-permalink\”>).*?(<)/”,”$1″.home_url(“https://wordpress.stackexchange.com/”).$parent->post_name.”/$2″,$page_link); } return $page_link; } Can’t … Read more

custom wordpress rewrite

WordPress has two kinds of rewrite rules- internal and external. Internal rules are parsed by WordPress and routed to index.php. External rewrites get written to .htaccess and are not directed to WordPress. Right now your rule is a mix between internal and external- you have it structured as an internal rule, but you have it … Read more

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