It can be done by using the request
filter. Something like this
function alter_the_query($request) {
return array('page' => 1, 'pagename' => null);
}
add_filter('request','alter_the_query');
Here it forces display of post 1, though of course you will want to do a query to determine the ID. For that, it might prove easiest to first parse the actual URI (from $_SERVER['REQUEST_URI']
) rather than use whatever info. WordPress provides (escaping the query string for security reasons, or using prepare()
).
Also, you may need some conditionals at the begining so it won’t break editing, archive display, etc.
Related Posts:
- How do I append multiple taxonomies to the URL?
- Custom Post Type: How to display all of same taxonomy?
- Remove Taxonomy Slug when No Taxonomy is Assigned to Custom Post Type?
- Using page title as a link to term archive
- Duplicate slug/permalink issue while adding same post name
- Is it possible for post and custom post type to share a category base slug?
- How to create a permalink structure with custom taxonomies and custom post types like base-name/parent-tax/child-tax/custom-post-type-name
- Shouldn’t this be easy?! Custom post type/custom taxonomy permalink
- Custom Post type & Taxonomy URL structure
- Combining Multiple Taxonomies in one URL
- Custom Taxonomy’s Label to change the text appearing in Appearance > Menu
- How to limit the number of terms (terms acts like categories)
- How can I list all the categories under a Custom Post Type (taxonomy)?
- Taxonomy term in permalink
- Why does a custom post type need the ”hierarchical’ args setting?
- How to modify URL structures in custom post types and taxonomies or terms
- Disable Single Post View for Specific Taxonomy on Custom Post Type
- array_pop() expects array, boolean given for $event_type_term ->slug
- Permalink rewrite with custom post type and custom taxonomy
- Custom Post Type with Nested Taxonomy and Template Files
- Semantic URL Custom Post Type and Taxonomies permalinks
- How to rewrite custom post type URL for multiple depths instead of one specific depth
- Disable WordPress Recognizing Path as Attachment
- Custom post type taxonomy template
- Include taxonomy slug in url?
- Custom permalink – append taxonomy name and term name at the end of permalink
- Taxonomy Templates
- custom post type and custom taxonomy url conflict
- Custom Taxonomy Creates Unwanted Integer Terms on Post Save
- Add hierarchical taxonomy to permalink for custom post type
- Custom post types, taxonomies, and permalinks
- Custom post types, taxonomies, and permalinks
- How can I move a custom taxonomy and its data from one post type to another?
- Permalinks not working for custom taxonomy on custom post type
- custom permalinks based on taxonomies for custom post type
- Custom taxonomy in URL showing 404
- Custom Taxonomies not appearing in Admin
- Custom Post Type permalink shows wrong page: homepage/index.php
- Custom Post Type Taxonomy Filters
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- Get related posts of child term of custom post type
- Show custom post archive when custom post not specified
- Show custom post type relationships by taxonomy
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- WordPress Doesn’t Generate Taxonomy Archive
- Custom post with more than one custom taxonomy
- Get the taxonomy of a post hierarchically
- Permalinks: custom post type -> custom taxonomy -> post
- CPT’s with landing page instead of archive – Url Rewrite?
- Custom post type permalink tag 404
- How to get list of taxonomy slugs ordered parents>childs?
- Hierarchical permalinks for custom post type and taxonomy
- How to organize hierarchical structure in custom post type with taxonomy (like with categories)
- Different Category system needed for the Custom Post Type
- Rename a slug label
- How to define a term for custom taxonomy
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- Template for custom post type when taxonomy is in the URL
- Query custom post types & Taxonomies and list them in a table on a page
- Creating custom post type posts and associating them with a post from another custom post type
- I have custom post type with custom taxonomy. But not found the taxonomy page..
- Getting List of child terms from custom taxonomy parent
- Is it possible to have hierarchical taxonomy and hierarchical custom post types in one permalink?
- Custom category URL not displaying posts
- Multiple permalinks for a single post with multiple taxonomies
- How to get post count of specific taxonomy that have store name & category
- Filter taxonomy by CPT
- How do you create pillar content pages?
- Custom permalink structure for custom post types including multiple taxonomy
- Custom post type single page returning 404 error when sharing archive url with custom taxonomy
- Get all posts for custom taxonomy term
- Permalinks: custom post type -> custom taxonomy -> custom sub taxonomy -> post
- Pretty Permalinks with CTP and Taxonomies / Hierarchical
- Customise Permalink Structure For Custom Post Types
- % encoded URL giving 404 error in WordPress
- tax_query not working?
- Issue with Custom Post Types and Permalinks
- Custom post type URL structure with site.com/custom_taxonomy_slug/post_name
- Custom permalink with custom taxonomies for custom post type
- I want to create an archive and single page for a custom taxonomy for a custom post type
- Taxonomy’s title
- Display all posts from single taxonomy term
- Connect 8 Taxonomies to One (Main) taxonomy. How to?
- Change the url of a custom post type to include taxonomy
- How to have permalink structure based on taxonomy terms
- Multiple post types or single post type with category taxonomy?
- Permalinks when using Custom Post Type with static page for archive
- How to change permalinks to taxonomy and post type’s posts
- Custom post type post taxonomies
- Adding 2 CPT with multiple custom taxonomies to permalinks
- Parent cpt/child custom post type URL permalink relationship
- Custom Post Type Permalinks Problem
- Problems with custom post type and hierarchical permalinks
- Permalink for Custom Post Types
- Remove slug from Custom Category Permalink + dual-category permalinks
- Display associated taxonomy child name on single CPT page
- Issue On Listing Woocommerce Parent Tag List
- Modify permalink of CPT archive to support two taxonomies