Removing “category” from URLs then “add_endpoint()” won’t work…
Removing “category” from URLs then “add_endpoint()” won’t work…
Removing “category” from URLs then “add_endpoint()” won’t work…
Remove “/page/1” from the URL
Because the database table is set up to auto increment then you can’t change the ID to match user ID without redesigning the database tables. This would be fine except you wouldn’t be able to update the plugin without remaking the changes each time.
Since your WordPress site is just a one-page site, this is served from the single URL http://example.com/. You then want http://example.com/<something> to be internally rewritten to http://example.com/app/<something>. You can add the following mod_rewrite directives before your existing WordPress directives (ie. WordPress front-controller) in your root .htaccess file: # Route all URL-paths (of 1 or more … Read more
Plugin action rewrite rule – non_wp_rules
Flushing rewrite rule should not be done on routine basis, as stated per codex: Don’t do it on any hook that will triggered on a routine basis. You should either do it via the plugin activation hooks, or the theme switch hooks: add_action( ‘after_switch_theme’, ‘wpse315001_flush_rewrite_rules’ ); register_deactivation_hook( __FILE__, ‘wpse315001_flush_rewrite_rules’ ); register_activation_hook( __FILE__, ‘wpse315001_flush_rewrite_rules’ ); function … Read more
Alias ‘wp-content’ directory to something shorter (framework?)
adding this in the functions.php file works. Just remember to re-save your permalinks & empty the cache a few times to see the changes. add_action( ‘init’, ‘wpse13483_init’ ); function wpse13483_init() { add_rewrite_rule( ‘category/(.+?)/orderby/([^/]+)?/?$’, ‘index.php?category_name=$matches[1]&orderby=$matches[2]&order=asc’, ‘top’ ); add_rewrite_rule( ‘category/(.+?)/orderby/([^/]+)/order/([^/]+)?/?$’, ‘index.php?category_name=$matches[1]&orderby=$matches[2]&order=$matches[3]’, ‘top’ ); // with pagination; add_rewrite_rule( ‘category/(.+?)/orderby/([^/]+)/order/([^/]+)/page/([0-9]{1,})?/?$’, ‘index.php?category_name=$matches[1]&orderby=$matches[2]&order=$matches[3]&paged=$matches[4]’, ‘top’ ); }
I’ve found this to be one of the more poorly documented features of WordPress, so hopefully this is on track or will be corrected by someone more fluent in WP_Rewrite. The basic gist is thus: During plugin activation and when flushing rules, ensure your custom rule is added to the list. During init, use add_rewrite_tag() … Read more
There are a few parts to making this work. First, we register the taxonomy: function wpa69163_register_txonomy() { register_taxonomy(‘board’, ‘post’, array( ‘labels’ => array( ‘name’ => _x( ‘Boards’, ‘taxonomy general name’ ), ), ‘rewrite’ => array( ‘slug’ => ‘board’, ‘with_front’ => false ) )); } add_action( ‘init’, ‘wpa69163_register_txonomy’, 0 ); Next, we have to add a … Read more