So after some digging managed to find the asnwer and instead of removing the filter you can overrid the single_template filter to add your own custom template.
add_filter( 'single_template', 'my_custom_single_template', 99, 1 );
function my_custom_single_template( $single ) {
global $post;
if ( isset( $post ) && $post->post_type == 'hotel-room' ) {
$single = require_once( STYLESHEETPATH . '/single-hotel-room.php');
}
return $single;
}
Related Posts:
- How to make a image-size selected by default in Media upload – WP v3.5
- static variable loop not working in WordPress
- adding a filter to a shortcode?
- Permanently remove first image from posts
- Change the footer text on the login page
- add_filter to post-gallery and remove all ‘s?
- How to overwrite youtube embed?
- Rewriting search and pagination base
- Change comments form title on a page by page basis
- Filter the blog title displayed in the header
- Display only text to WordPress loop without loosing the text formatting
- Remove class that has been added by parent theme
- append PHP function to the_content
- “Maximum function nesting level of ‘100’ reached” after adding a new filter
- How do I know what variables are passed in a filter/action and what their meaning is?
- body_class filter – Is there a better way to write this code?
- How to add Shortcode (font awesome) in widget title?
- Woocommerce filter cart and category specific quantity [closed]
- Wrap First Character after in a tag
- WooCommerce: Add Payment Gateway Field to Webhooks [closed]
- How to call function at the bottom of post using plugin?
- Problem adding class to body_class
- Run a filter when a walker runs
- Handling Body class based on Template
- Get_avatar filter?
- Nesting if statements to echo only one string based on what tag was filtered?
- How to properly loop through these external URLs to get them into the sitemap using this hook
- Input type search in Menu
- Is it acceptable to treat a filter like an action?
- How can I remove a function that has been added to wordpress with add_filter?
- Edit incorrect password message WordPress
- How do I add custom bulk actions to multiple custom post types?
- Show prices with tax in Woocommerce Mini Cart [closed]
- Why does my callback function not work with this custom filter hook?
- Contact Fom 7 – how to add custom HTML inside span.wpcf7-form-control-wrap AND IMMEDIATELY AFTER input.wpcf7-form-control?
- Add filter when image is uploaded?
- Remove a div from RSS feed
- WordPress Gravatar filter is removing my custom attributes
- Generating an nonce for Content Security Policy and all scripts – How to make it match/persist for each page load?
- Unique icons next to each WordPress menu item
- Problem with login form
- Alter required message using comment form api
- How to edit php code in WordPress Post file?
- Change page title from page using php via php executed from page/post itself
- Override a function defined in wp-includes/comment-template.php
- Content filter won’t work
- Warning: in_array() null given in PHP function
- Upload multiple files in randomly generated folder using wp_upload_bits
- Create page template via functions.php?
- How to have different site identity logos on each page on Astra Theme [closed]
- How do I create a secondary version of the_content
- Get the_content surrounded by instead of
- Displaying content on posts page based on category
- Can I remove or edit an include() from a function with a filter?
- Dynamically adding filters
- WordPress doesn’t load HTML
- apply_filters with several different values?
- How can I modify this code to make the search box include tags and meta
- How to add a custom filter (by coding) before access one wordpress page ? And where to call the custom filter?
- How to sort WooCommerce products page by latest in-stock items first?
- How do I make these combination select filters work when only one dropdown is set? They work in WordPress 5.8.2 but don’t in 5.8.3
- Show related products by attribute based and certain conditions
- How to Create custom block for displaying information in content section which act like shortcode
- Test the existence of a page/article by its URL, taking in consideration the URL rewriting by filters
- Filter ‘comment_notification_text’ not working
- How to run php code only for a specific widget on a page and not all widgets on that page?
- How to remove get_header From all single pages in wordpress with functions.php without plugin?
- Change the “Show All” button in a WordPress Portfolio Filter
- Change lost password url to a mailto URL in WordPress
- Shortcodes not processing inside post content
- Remove span tags from WooCommerce Downloads page
- Add a top bar to a wordpress theme without editing the header.php file?
- I want to hide “sold by” on certain pages with id page 43
- Fatal error: Uncaught Error: Class ‘WP_Block_Styles_Registry’
- using filter and hook inside class
- How to bind each “the_content” elements to a custom variables
- Filter portforlio with librairie isotop
- add_filter() inside another add_filter()
- How to filter specific element of an array in wordpress/php?
- Redirecting the lost password page request when using a custon login page
- Custom Bulk Actions handler not firing
- How to generate customized filtered output for the gallery
- dynamically change content of div with php
- Add a leading zero to pagination
- str_replace not preserving whitespace
- How to apply filter
- Add custom filter to register data in array
- Display a post based on its metabox selection
- WordPress – show all posts + ones with specific tag
- Search box background on a different page template
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- How to add different menu items on different menus?
- How to pass value to add_filter wpcf7_form_tag from another function?
- Add text below WooCommerce short description if metabox value is true
- How rename wp-content and wp-admin folders correctly
- Unable to logout correctly after wp-login file was modified
- Show post in elementor based on views and specific category with query id feature in elementor
- Prevent publishing of uncategorized posts
- WordPress query_posts with multiple tax_query
- Filtering with Attributes – how to display all non-queried products below query