Custom Permalink Tag breaks Pagination

Thanks to Milo’s help the code in the question ended up working: permalinks fixed and the structure stayed exactly how I wanted it described in the question above. Removed the rewrite_rules_array hook entirely Moved my taxonomy registration above my post type registration Changed the taxonomy to be non-hierarchical ‘hierarchical’ => false From my limited understand … Read more

Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?

With helpful tips from Milo, I was able to remove the taxonomy slug when no taxonomy is assigned to the custom post type by adding the following code to the updated functions above: add_filter( ‘request’, ‘project_request_filter’ ); function project_request_filter( $request ){ if( array_key_exists( ‘project’ , $request ) && ! get_term_by( ‘slug’, $request[‘project’], ‘project’ ) ){ … Read more

Top level Pages redirecting to homepage!

It turns out that, I was using “year” as a custom taxonomy, which was part of the reserved terms of WordPress!!! With using the reserved term, it will return the 404 error for the top level pages, hence the redirection to the home page. !!! Listed here: https://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms

How to map a URL to a specific template?

Please place below code in your theme’s functions.php file & let me know how it goes 🙂 add_action(‘wp’, function(){ list($uri, $qs) = explode(‘?’, $_SERVER[‘REQUEST_URI’]); if ( $uri == “/arbitrary/path” ) /* Change this to path that you want to match*/ { locate_template( “template-full-width.php” , true, false ); /* Don’t forget to replace template name with … Read more