if ( ! in_array( $post->post_type, array( 'internal_doors' ) ) || 'publish' != $post->post_status )
replace above with
if ( ! in_array( $post->post_type, array( 'internal_doors','custom post type name1', 'custom post type name2' ) ) || 'publish' != $post->post_status )
and
if ( ! empty( $query->query['name'] ) )
$query->set( 'post_type', array( 'post', 'internal_doors', 'page' ) );
replace this with
if ( ! empty( $query->query['name'] ) )
$query->set( 'post_type', array( 'post', 'internal_doors','custom post type name1', 'custom post type name2', 'page' ) );
note: change custom post type name1, custom post type name2 with your original names
Related Posts:
- Put a link to a category round a hard coded A HREF
- WordPress custom slug (endpoint) and compare all links
- php script to change slug in post automatically
- Allow two posts (from different categories) to have the same slug
- Test the existence of a page/article by its URL, taking in consideration the URL rewriting by filters
- Custom PHP form needs refresh to load page correctly
- Rewrite rule not working, but only when parameter is text
- Weird slug in archives permalink
- How to get URL of current page displayed?
- Disable Attachment Pages Completely
- how to get permalink structure with php
- How to Remove Parents Category Permalink from Posts
- add_rewrite_rule with bottom priority doesn’t handle the WordPress pages
- How is WordPress manipulating the posts like there are folders?
- wordpress upgrade has broken my permalinks
- Do changes to WordPress permalink custom structure affect old urls?
- Rename “Portfolio” slug?
- How to query for pages/post depending on slug?
- Global variable $post returning incorrect object
- How do you use WP slugs for PDF files / media?
- Add prefix to link url
- What is an equivalent of single_cat_title for getting the slug of the category?
- 200 Rewrite blog post links
- What query string parameter is available for index.php, that works for both pages and blog articles?
- wp_trim_words() does not work with my code Am I doing any mistake in my code?
- Changes in permalink structure in WordPress and how to apply to in-site links
- WordPress Persistent connection rule does not work for “posts”
- WordPress every page is 404 not found including admin resources
- WordPress returning 404 for multisite pages
- How to use $_GET function WordPress backend
- How to get post permalink url without a href
- List taxonomy term slugs within shortcode (do_shortcode)
- Change product_base programmatically
- Divi change project category slug
- page-slug.php not working but only for specific slug
- Custom post type permalinks do not appear using the link functions
- How to Handle Going Backwards in Navigation When Referrer in PHP/JavaScript won’t work?
- .html end of URl affected to SEO?
- Search only working on front page (index) , not working on other pages
- how to edit a specific post slug using a php code?
- Creating a Category Taxonomy
- Getting the slug into a variable, how to echo that variable
- Insert PHP code in Text
- Permalinks: site.com/post-tite vs site.com/post-id/post-title for SEO and Speed
- Can not call .php files after switching to %postname%
- WordPress permalink issue
- Change permalink structure specific category
- understand what code is doing when prepending /blog
- Custom URL for multiple categories hierarchy
- WordPress redirects to localhost
- 404 on old link after changing post url
- Get nice name of category from slug (remove dashes of category)
- url not using query string no longer working
- Child-Theme Category View with modified permalinks (%category% removed)
- How does Permalink work with the AMP plugin after Removing Parent Permalink Catalog from Posts
- Get WordPress username to customize url
- Permalink doesn’t navigate to post (changes only url)
- Permalink changes after several minutes after saving post
- How to edit button permalink inside function.php using a child theme?
- WordPress generates weird permalinks
- How do I stop my form from adding code to current page URL instead of re-directing. Been stuck for days
- image on homepage disappeared due to change of permalink name
- Exclude a category slug on pagination
- Custom content using in_category
- What is the proper way to call a function (from functions.php) on a link click?
- How do I generate formatted permalinks as specified in backend options?
- 403 Forbidden Localhost Wamp Apache Php
- How can I output the slug of a comment author?
- redirect 301 with special character like WIX site “#!”
- Permalinks and custom PHP application
- WordPress using get_term to retreive slug not working as expected
- How to solve 404 permalink errors on nginx server
- Some links broken after updating WordPress version
- add_rewrite_rule questions
- php string inside shortcode does not work
- WordPress Rewrite Issue
- Would it be possible to route WordPress Through an MVC Application
- set new link as permalink
- Multiple URL from Custom post name
- append links with unique number string
- get_category only returning details for ‘uncategorized’
- Get permalink for a post from inside WordPress and route to a related site
- custom data in url
- Make a permalink to the most recent blog post
- PHP code for link with text
- Remove /category/ from category (archive) page URLs (without using a plugin)
- Accessing WordPress Functions get_permalink() in Vanilla PHP?
- WordPress add parameters with friendly url structure
- Add any username as link prefix and show data from that specific user’s profile on wordpress pages – with no login required
- how to goto specific page number including title with permalink
- How to extract URLs from wordpress taxonomies
- WordPress 6.1.1 UTF8 Slug Limit Increase
- How to disable page create for custom post type, but allow a page with the post types slug to be created?
- Remove /Page/ from slug when we’re visiting 2nd and other inner pages of the blog page
- Create a custom plugin with dynamic child pages listing database records
- WordPress CPT & Custom Taxonomy with the SAME Permalink Structure
- Remove slug of multiple custom post types with and without hierarchical
- WordPress per ACF – permalink is not working
- Processing data and redirecting with query string
- Post returns 404 after changing the permalink using post_type_link