Tag Info

New answers tagged

0

Isn't what you are trying to achieve the point of the rewrite slug? e.g. if you have a news category as press and another as event then simply changing register_taxonomy('news_category', 'stfp_news', array( 'hierarchical' => true, 'show_admin_column' => true, 'label' => __('Categories'), 'show_ui' => true, 'query_var' => false, 'rewrite' ...


1

Considering WordPress Codex flush_rewrite_rules This function is useful when used with custom post types as it allows for automatic flushing of the WordPress rewrite rules (usually needs to be done manually for new custom post types). However, this is an expensive operation so it should only be used when absolutely necessary.... I'd recommend you to ...


0

you may try to de-register/unset default post type and register post type with your requirements. if ( ! function_exists( 'unset_default_post' ) ) : function unset_default_post( ) { global $wp_post_types; $post_type = 'post'; if ( isset( $wp_post_types[ $post_type ] ) ) { unset( $wp_post_types[ $post_type ] ); return true; } ...


1

It is excruciatingly painful to deeply customize WordPress load process. It's not quite clear if your requirements here are performance related or tied to soemthing else. For your question as stated there would be about following approaches (madness ascending): get rid of actual code causing unwanted queries, altogether or via techniques like caching ...


0

It might be an .htaccess issue. Sometimes I try to flush the rewrite rules from the command line and it doesn't rewrite the .htaccess file until I go into the /wp-admin section, go to 'Settings > Permalinks' and just save it without making any modifications. See if that works.


0

I used the following functions to solve this problem. //This adds a custom query variable to the permalink function add_custom_query_var( $vars ){ $vars[] = "shop_name"; return $vars; } add_filter( 'query_vars', 'add_custom_query_var' ); function add_rewrite_rules($aRules) { $aNewRules = array('shop/([^/]+)/?$' => ...



Top 50 recent answers are included