I refactored the if conditional using suggestions from Jacob Peattie and the following fixed my issues.
if ( ! is_page_template( array( 'template-investment.php', 'template-tourism.php' ) ) && ! is_tax( 'listings' ) && ! is_singular( 'listing' ) ) {
The result correctly removed the sidebar.php from loading its code on specific templates, taxonomy, and single post type.
Related Posts:
- is_page_template not working as expected
- Clean URL permalink for custom post type
- Custom post type loops with different page templates
- Custom Post Type .current-menu-item not applying on Custom Post Type Archive Page
- Custom Post Type Taxonomies -Posts not showing in Category or Tag pages
- Using wordpress template tags within an array
- Template code to split a post and print a custom field?
- Load info from customposttype into template page
- Accessing download link from the loop with WP Download Manager Pro
- Why isn’t my custom post type using the corresponding custom post template?
- PHP Button Custom link [closed]
- Move Genesis Single Page/Single Post Title
- Is This Code Efficient – Or is there a better way?
- make permalink go to a custom single.php file
- Add Previous/Next Buttons to CPT Single Pages Only
- Control content before and after custom post type loop
- Custom Post not working as expected
- How to use a variable as a function name?
- Creating Sections for Post Types
- Check IF single OR multiple custom data has been entered
- Get custom post type categories to show up in menus
- Custom post types with categories in template
- How to check if post/page or taxonomy post is published by admin
- Saving fields in a drop-down in WordPress
- TinyMCE Buttons on Certain Post Type
- Creating separate feeds for custom post types
- Displaying custom post types as a gallery
- Which file/template is in charge of taxonomies for custom post types?
- Assigning a category to a custom post type in WordPress
- Show current custom taxonomy
- finding and using post type fields in WordPress
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states
- How can I trace inconsistency in loading a template?
- Is there a way to create two template for single custom post type page?
- How exclude or skip post type with get_next_post_link
- WordPress: Custom User Role cannot access Custom Post Type | “Sorry, you are not allowed to access this page”
- How do I add custom HTML to the content of an archive page’s posts?
- Different options per post type in WP_Query
- After creating Custom post type by user delete old one
- How to get_term_meta on single custom post?
- widget_posts_args not using the number of posts in widget
- Show message when query has no posts
- Display message if no posts in Custom Post Type loop
- Showing taxonomy terms on custom post type
- Create short URL with auto 301 redirect
- How To Post WordPress Custom Post Types to Twitter via IFTTT
- Pagination hitting 404 page on /page/4
- Get data from PHP to JavaScript to set position of each post on front page
- Undefined $post in wp_query
- Get posts from Custom Taxonomy
- Assigning alternate single-{cpt} template based on blog_id in multisite
- How do I create a new post upon registration with the users first and last name as title
- Removing full title and breadcrumb header container for a specific post type
- Is it possible to use array_walk() to append terms to an array of posts?
- How do I find a way to create a global single.php for a custom post type?
- How do I assign a block template (.html) to a custom post type?
- Templates for hierarchical custom post type
- Query entries from custom post type in an ACF flexible content field
- get_post_types() can’t get some of my post type
- Creating a non-hierarchical Taxonomy that behaves like categories
- How to use single.php for creating, reading and editing Custom Posts with ACF
- Creating shortcode id for custom post types
- When I choose category from dropdown then everything working fine.But in backend it checked only child not parent [closed]
- Shortcode is displaying the content on top of the page [duplicate]
- get_terms() returns Trying to get property of non-object error for custom taxonomy
- Filter content in shortcode
- Query custom post types & Taxonomies and list them in a table on a page
- Custom Post Type setup
- Custom post type and custom taxonomy 404 on page 2
- Apply template by path/slug related to custom post type?
- Creating a “glossary” of WordPress posts of a specific post type
- Show current user posts in custom post type query
- assign different templates to custom post type with homepage loop
- Using Pagination for Custom Post Type and keeps returning 404
- Custom Ratings for Theme, Proper way to Refactor Code and Clean up Template File
- Check if custom post is a parent?
- How to get the current category with custom posts
- Custom post type is using the index.php template
- Importing JSON feed giving Notice: Array to string conversion error
- How to add new post using a form to categories when categories are using as menu
- How to set the mainpage of a custom post type?
- Assign a template to a custom post type when displayed by the main loop on the home page
- Different post title, keywords and description
- post_content is stripping HTML when adding a new post? [closed]
- custom post type by author – wp job manager
- Querying a custom post type, but not show duplicates
- Nested Custom Taxonomies | Incorrect posts when querying
- List latest post out of 2 custom post types
- I’m trying to create a custom version of the wp_list_authors function that includes custom post types
- Validate Custom Post Type fields
- meta query not retrieving posts
- Get template part with CPT and Custom Taxonomy conditionals
- Using Wp_Query, Json to add Highcharts series data
- Displaying a list of Contacts
- How to create a template to show child terms of a MAIN taxonomy
- How to change single custom post template by custom taxonomy?
- How do I get the index for a custom post?
- Commas not displaying in implode
- Custom Post Type homepage template
- add custom tags for custom post type in wordpress