What is with the one month time limit for sub directory installs for multisite network?

There is nothing happening at one month, and nothing “locks” permalinks. There is no actual difference in the system, the only difference is in the initial multisite configuration interface. When you first define WP_ALLOW_MULTISITE to true, and visit the network screen, you get the initial setup menu which lets you set up the configuration. It … Read more

How to get raw unwritten querystring

$_GET refers literally to ?p=1 part of URL. With pretty permalink if it’s empty then there is nothing to access. WordPress processed either case into query variables of WP_Query class. You should use get_query_var() to retrieve things like this, so in this specific case it would probably be get_query_var( ‘p’ ).

Two custom taxonomies in permalink structure

First issue- the permalink structure in Settings is only for the post post type, so your post_type_link function has no %types% tag to replace. Second- unless you want a very complicated (and less performant) solution, the simpler solution is to have a static prefix in your post type slug. With the URL http://domain.com/type/location/post-name/, WordPress has … Read more

Combine category AND custom taxonomy in permalink structure

What I ended up doing was setting up an endpoint for food, like so: global $wp_rewrite; $wp_rewrite->add_endpoint( ‘food’, EP_PERMALINK | EP_PAGES ); $wp_rewrite->flush_rules(); function printview_query_vars($vars) { array_push($vars, ‘food’); return $vars; } add_filter(‘query_vars’,’printview_query_vars’); Then I’d get a url like http://mysite/pagename/food/fruits/shelves/ and the wp_query would contain something like food=>fruits/shelves, which then i can parse myself into a … Read more

CPT, meta-data, url parameter

The good answer was from @Milo, but he haven’t posted any code, so I post here my result, for people coming here for the right answer. /* Add query var to authorized query var… */ add_filter( ‘query_vars’, ‘add_spectacles_query_vars’ ); function add_spectacles_query_vars( $query_vars ) { $query_vars[] = ‘spectacles-year’; $query_vars[] = ‘spectacles-month’; $query_vars[] = ‘spectacles-day’; return $query_vars; … Read more

WordPress Permalinks 404 bug with “next” button

I fixed the problem by editing my .htaccess file. I replaced it with the following. # BEGIN WordPress <IfModule mod_rewrite.c> ErrorDocument 404 /index.php?error=404 RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress

When WP_Query only returns 1 post, how do I automatically redirect to that post?

You can do this by checking the number of results returned by your query. Try this. <?php $rawfiltertag = get_post_meta( $post->ID, ‘_cmb_client_name’, true ); $filtertag = sanitize_title( $rawfiltertag ); // wp_query arguments $args = array ( ‘post_type’ => ‘post’, ‘meta_query’ => array( array( ‘key’ => ‘_cmb_client_target’, ‘value’ => $rawfiltertag ) ) ); // the query … Read more