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?
- Custom Taxonomy back-end customizations
- Taxonomy custom post type URL
- Custom post type url with category
- Adding custom post category slug in permalink causes 404 error for pages and posts
- How to Filter custom post type by taxonomy?
- How Can I Change the Custom Post Type Slug to the Taxonomy Slug in the URL?
- Is it possible to have dedicated page for parent/child taxonomy?
- Use same slug base for Custom Post Type posts, and multiple taxonomy terms
- How to have the same url structure for both a CPT and a Taxonomy?
- How to create custom url structure based on custom post type rewrite slug, taxonomy and category slug?
- create a subcatagory for a custom post type and out put url as posttype/subcategory/item
- Why are taxonomy terms not saving when using custom meta boxes with radio button taxonomy selectors?
- Get related posts of child term of custom post type
- Limit amount of posts made within a custom taxonomy
- custom-taxonomy/post_name instead of the default post_type/post_name
- Show custom post archive when custom post not specified
- Show custom post type relationships by taxonomy
- Issue on Creating Custom Tax Term Dynamically From Another CPT Meta-box On Publish
- Can’t remove front from permalinks for custom taxonomy category page
- list taxonomies from a custom post type
- Display a grid of taxonomy terms at root taxonomy page
- Removing custom post type slug from URL
- Customize Custom Post Type URL
- limit value taxonomy based on previous taxonomy value wordpress
- Permalinks /country/city/cpt/postname/
- Seamless permalinks between Custom Taxonomy and Custom Posts
- Custom post type and custom taxonomy with the same slug using the file page taxonomy only as directory
- How do I display the taxonomy for a custom post type in an array
- Custom Permalinks with CPT and Hierarchical Taxonomies
- How to conditionally redirect to the post from a taxonomy page?
- How do I check if the user is on a taxonomy term parent, child or grandchild page?
- How do I display the grand child items of a taxonomy term?
- Taxonomies relations
- Is it better to use WordPress Custom Post Types or Taxonomies?
- Full Custom Post Type List Organised by two Taxonomies
- WordPress Doesn’t Generate Taxonomy Archive
- How to have this permalink structure: post_type/postname/custom_inner_page
- Suggested Post and Taxonomy structure
- Custom Permalink Structure for Custom Post Type, Custom Taxonomy, Under a page
- Custom taxonomy returns 404
- Custom post with more than one custom taxonomy
- Get the taxonomy of a post hierarchically
- Adding custom taxonomy in same menu place with two custom post types
- How to make custom taxonomy into drop down select in a custom metabox
- Permalinks: custom post type -> custom taxonomy -> post
- CPT’s with landing page instead of archive – Url Rewrite?
- How to change permalink to include custom post type
- Custom post type, permalinks, taxonomies and blog posts
- Custom post type permalink tag 404
- How to get list of taxonomy slugs ordered parents>childs?
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- permalink /category/post-name with custom post type and taxonomy
- Custom post type and taxonomy permalinks
- How do I share categories across multiple post types?
- Hierarchical permalinks for custom post type and taxonomy
- How to organize hierarchical structure in custom post type with taxonomy (like with categories)
- Multiple tag cloud filtering
- Get url.com/post_type/taxonomy/term work!
- set permalink for CPT
- How to display products name in a non-alphabetical order, in a custom field (taxonomy)?
- Taxonomy in URL
- Custom permalink with child taxonomy terms
- Custom post type Permalinks with hierarchical Taxonomies
- Different Category system needed for the Custom Post Type
- Custom Post Type Category Link
- Custom Post type category pages template and loop
- How to solve this custom post type goes to 404 page?
- How to Set Taxonomy Object Description?
- Best way to specify “article type” in URL
- Template files for Custom Post Type and Taxonomy
- Custom select query for taxonomies that have posts categorized in another taxonomy
- Custom Taxonomy Is Being Pulled into a Page, But It Doesn’t Have A Hyperlink
- Querying two taxonomies with tax_query not woking
- Rename a slug label
- Can’t use pagination with custom taxonomy
- Hide specific taxonomies from a taxonomy list using ‘get_object_taxonomies’
- Custom taxonomy (categories) on custom post type return no results
- Variable not working in WP_Query
- Hide meta box for everything BUT a certain custom post type
- get_category_link() for custom post type does not include custom slug rewrite?
- Targeting categories in custom fields
- How can I create an automatic drop down menu with my tags?
- How to define a term for custom taxonomy
- List custom taxonomy as navigation – taxonomy pages with all it’s posts?
- Alphabetically sort a taxonomy.php template by post title
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Template for custom post type when taxonomy is in the URL
- Permalink problems with custom post type and custom taxonomy
- Get taxonomy singular name instead of taxonomy slug inside $taxonomy query
- Show Taxonomies with admin area for custom post type?
- Custom taxonomy template list not working (404)
- Use the custom post type archive for taxonomies?
- Rewrite custom post type with taxonomy
- Custom Post Type Advanced Slug