rewrite file to wordpress

WordPress rewrite mechanism works in a different way, not like .htaccess rewrite rules. More information about it you can find in codex (Rewrite API, WP_Rewrite, etc.). But fast work around could be the following: First of all we need to register our query var and rewrite rule: function myplugin_add_query_var( $vars ) { $vars[] = ‘myplugin_api’; … Read more

Category URL Management

You could filter ‘term_link’. just an untested idea, written directly into the answer field add_filter( ‘term_link’, ‘wpse_55476_categore_ur_filter’, 10, 3 ); function wpse_55476_categore_ur_filter( $termlink, $term, $taxonomy ) { if ( ‘category’ !== $taxonomy ) { return $termlink; } // separate the URL $parts = explode( “https://wordpress.stackexchange.com/”, $termlink ); // get the term $term_slug = array_pop( $parts … Read more

database not responding on localhost

Yes, while convenient, let’s rule out the variable of using the $_SERVER[‘HTTP_HOST’] trick and put in the absolute URLs. Here are some handy snippets I use when moving a site (you may want to use these to make sure everything is the same on your install): UPDATE wp_posts SET guid = replace(guid, ‘http://www.olddomain.com’,’http://www.newdomain.com’); UPDATE wp_posts … Read more

Custom url structure – pages under a custom post type

example.com/event/london-2012/speakers/john-doe You need an “event” post type and a “speaker post type. The event post type should be hierarchical and should have a sub-page called “speakers” which should use a custom template that displays all the “speaker” post types assigned to that event (see the Posts 2 Posts plugin). Then you can create other sub-pages … Read more