How would I leverage custom Taxonomies in this scenario?

First I would create a new custom post type called Trips. Add this to your theme’s functions.php //trips Custom Post Type add_action( ‘init’, ‘create_trips_post_type’ ); function create_trips_post_type() { register_post_type( ‘trips’, array( ‘labels’ => array( ‘name’ => __( ‘Trips’ ), ‘singular_name’ => __( ‘Trips’ ) ), ‘public’ => true, ‘has_archive’ => true, ‘hierarchical’ => true, ‘supports’ … Read more

Removing rules from .htaccess

Problem 1 Your hook ci_add_rules() will still run when you flush rules, so remove it first (and avoid “unsetting” non_wp_rules, you’ll break other plugins that make use of it). function ci_remove_rules() { remove_action( ‘generate_rewrite_rules’, ‘ci_add_rules’ ); $GLOBALS[‘wp_rewrite’]->flush_rules(); } Problem 2 Pretty sure you want: plugin_dir_url( ‘proxy.php’, __FILE__ ) ..instead of: plugin_dir_path( __FILE__ ) . ‘proxy.php

How to change ?lang=cn into /cn/

Set permalink to (Post Name) or http://www.example.com/[blog_name]`/%post_id%/%postname%/` Add following code to functions.php of your theme: add_filter ( ‘alias_rule’, ‘xili_language_trans_slug_qv’ ) ; function xl_permalinks_init () { global $XL_Permalinks_rules; if (class_exists(‘XL_Permalinks_rules’) ) { $XL_Permalinks_rules = new XL_Permalinks_rules (); add_permastruct ( ‘language’, ‘%lang%’, true, 1 ); add_permastruct ( ‘language’, ‘%lang%’, array(‘with_front’ => false) ); } }

Add rewrite rule in plugin: with .htaccess in plugin folder or using WordPress functions

NOTE: WordPress Rewrite API is not the same as Apache Rewrite module. WP Rewrite API doesn’t redirect a request to another URL, it used to parse current URL and fill query_vars array. The issue is in the second parameter of you add_rewrite_rule function call. It has to start from index.php? and then there should be … Read more

Defining a default page for custom post type

You can kind of fake it before the main query is run with the pre_get_posts action: function wpa84126_single_project_archive( $query ){ if( ! is_admin() && $query->is_main_query() && $query->is_post_type_archive( ‘new_projects’ ) ) $query->set( ‘name’, ‘my-new-project’ ); } add_action( ‘pre_get_posts’, ‘wpa84126_single_project_archive’ ); Make sure to change new_projects to the actual name you’ve registered the post type under. It … Read more

WP Login forms action URLs displayed as pretty URLs in browser (ex with Restore Password)

Step 2. However, when I submit an un-matching password, the form is redisplayed and URL is now http://example.com/wp-login.php?action=resetpass&key=xyz&login=zyx. Notice, that action has changed. When I attempt this with an invalid key I get redirected to http://example.com/wp-login.php?action=lostpassword&error=invalidkey. Anyway, the infinite loop is occurring because you are the condition in_array( $action, array(‘rp’, ‘resetpass’) ) remains true for … Read more