I found solution. Big Thanks @Scribu Alternative to query_posts for main loop? Now works fine and no more 404 error.
function wpse49295_alter_the_query( $request )
{
$dummy_query = new WP_Query();
$dummy_query->parse_query( $request );
if ( $dummy_query->is_single() )
$request['post_type'] = 'topic';
return $request;
}
add_filter( 'request', 'wpse49295_alter_the_query' );
Related Posts:
- Custom Post Type URL Rewriting?
- Add .html (dot HTML) extension to custom post types
- Multiple post types – share same ReWrite slug?
- How to pass URL parameters for advanced taxonomy queries with multiple terms for one custom taxonomy
- Custom post types – Use post_id in permalink structure when using has_archive => true
- How to modify URL structures in custom post types and taxonomies or terms
- Slug for custom post type archive
- Change page /2 to /transcript with a Rewrite
- Permalink rewrite with custom post type and custom taxonomy
- Make permalinks based on an ACF-field
- How would I leverage custom Taxonomies in this scenario?
- WordPress returns 404 on custom rewrite rule conflict in parameters
- How to create download links based on Custom Fields with Rewrite API
- How to rewrite custom post type URL for multiple depths instead of one specific depth
- Regex problem in an add_rewrite_rule
- Multiple Permalinks for custom post type post
- Interesting Custom Post Type Slug with Taxonomy and Custom Field
- WordPress Rewrite rule for nested post types
- Category base to url in custom post type/taxonomy
- Is slug “type” reserved and can’t be used in taxonomy rewrite?
- Custom Post Type get_post_type_archive_link( $post_type ) returns false
- Permalinks when filtering multiple custom post types by single taxonomy
- custom taxonomy archive by year
- How to Combine Two Custom Post Types into Single Permalink Structure
- Redirecting when changing custom post type slugs?
- How can you handle rewrite rules for custom post types with option to filter on custom taxonomy terms?
- Conditional regex in add_rewrite_rule() for specific query filters & pagination
- How to remove slugs from multiple custom post types
- Displaying Posts of a Custom Type
- Can’t change first part of URL rewrite for custom post type
- CPT Archive with core Category
- Custom taxonomy in URL showing 404
- Relative URLs for a particular custom post type?
- Custom Taxonomy URL are redirecting to page with the same name
- Rewrite slug of custom post type to include post-id
- How can we take into account post types when constructing permalinks?
- Taxonomy custom post type URL
- How to change custom post type permalink structure
- Front custom edit post page for each post
- Categories of Custom Post throws gives 404
- How to build custom route by adding taxonomies to URL ? ex: www.demo.com/communities/palo-alto/
- 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
- Rewrite Question Mark in Post Template to Make it Pretty URL
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- Custom Permalink to remove category word , keeping posts permalink with date?
- WP Rewrite Rule Issue while using Custom post type & taxonomy
- WordPress custom post type split into pages
- WordPress uses url different from defined in rewrite arg of custom post type
- Including taxonomy term before post type breaks top level pages
- Correct procedure for advanced permalinks
- Custom Post Types hierarchy and rewrite
- How to get list of taxonomy slugs ordered parents>childs?
- Rewrite rule for Custom Post Type Page as a parent
- Rewrite Endpoints and CPTs – How to use in a plugin
- add_rewrite_rule and passing variables for custom post types
- Specific routing for CPT
- Lost of query parameter when using permalink
- Custom permalink with child taxonomy terms
- Custom post type archive with page as parent url
- Pagination custom post type not working with rewrite slug
- Custom Rewrite Rule for Custom Post Type with URL Param
- WordPress custom slug rewrite
- WordPress Custom Post Type – Rewrite Query
- After creating Custom post type by user delete old one
- Set parent for custom post type archive rewrite url
- Dynamic CPT permalink structure based on ACF field value
- URL Rewrite – Page Archive
- Urls in Custom Post Type work for Terms but not for its Taxonomies
- custom post archive URL is wrong
- Rewrite rules for custom post type
- Custom taxonomy and post type rewrite rules
- Custom Post Type and Taxonomy Rewrite Error
- custom posts permalinks url rewriting
- WordPress is ignoring my post rewrite rule
- Url Rewriting a dynamic wordpress page with parameters
- Custom Permalink For Custom Post Type – Working Fine But Broken For Pagination
- I want to rewrite the URL of a specific post with a specific custom field to easily analyze in Google Analytics
- Duplicate content problems after adding an archive page to the article’s post type
- Display CPT taxonomies as an archive page
- CPTUI rewrite disable when no post in CPTUI has been found
- Redirect Custom Post Type from Child Taxonomies
- Set archive of custom post type like ‘posts’ page in reading settings is set
- Register post type getting error 404
- Custom post type rewrite and wp_pagenavi interfering with each other
- CPT url rewriting : regular posts return 404 error
- redirect old post type url to new structure url
- One custom post type with two different url structure base on taxonomy term
- Why is a custom post type’s URL “/?cposts=name-of-the-post” but default post’s URL is “/?p=ID”?
- How can you preserve URLs when moving posts to a custom post type?
- Custom Post Type Base URL
- Custom Taxonomy in Permalink from post type
- How to rewrite custom slugs that follow my rules
- Custom post type with custom taxonomies structure url not working archive of CPT
- What is the best way to relate different custom post types?
- Allow child pages with the same base as the CPT slug
- How to work with URLs where sometimes a post or a subcategory is in the same part of the URL structure
- How to make 2 (or more) custom post type post pages sit under the same slug?
- Remove date rewrite rule for custom post type archive page
- Display content based on multiple URL parameters—pretty URL or query string