You need to use the AND
(&&
) operator to make this work. As your condition stands, it will return true no matter which page you are on. The OR
operator only needs one true to execute where as the AND
operator needs all conditions to be true to execute
I just have one other concern here as you are loading your footer conditionally, and that is, you should make sure that you remove wp_footer()
from that condition, you should not load it conditionally as this will break many scripts that is loaded in the footer. So make sure that you don’t load wp_footer()
conditionally
Related Posts:
- How do test if a post is a custom post type?
- Conditional for single-{post-type}.php
- is_singular() not working if called via callback function of admin-ajax.php
- functions.php conditional tag only for custom post type
- Exclude custom function content from certain pages
- Get template part based on custom taxonomy term
- If on term-page -> get the current term?
- custom post type upcoming post and past post
- changing default comment form arguments [duplicate]
- is_page_template not working as expected
- remove child post from custom post type archive
- if custom posts type exists and there are posts load script
- Need help targeting a custom post type with conditional tags
- custom comments on specific post type
- Excluding custom post types
- Register widget only page is a singular of custom post type
- Is there a conditional tag to determine whether the post is _any_ custom post type?
- Conditional Query of Custom Post Type and custom taxonomy
- How to run filter only on custom post type edit screen
- Conditional statement for if archive page has posts which contain certain taxonomies/categories/tags, show those terms
- Custom Post Conditional for Parent & Child Single.php?
- Conditional for a Single Post That Belongs to a Category?
- How to show only the most recent post on my custom post type archive?
- Conditional Tags for specific category of custom posts
- Move Genesis Single Page/Single Post Title
- How to check if post/page or taxonomy post is published by admin
- TinyMCE Buttons on Certain Post Type
- Display message if no posts in Custom Post Type loop
- Showing taxonomy terms on custom post type
- Check if custom post is a parent?
- Redirect to URL if x number of days passed
- comments hooks on custom post type
- Conditional Statements
- If custom taxonomy else conditional [closed]
- If tag exists, then echo once
- Show specific content on parent custom post type and all children
- Should i use custom post type for a custom footer?
- Use conditionals with wp_enqueue_style to attach stylesheet according to post type displayed
- How can I check the rewrite slug of current post type listing page
- How to add custom PHP code in post header?
- $_SESSION Not working after X amount of page views
- conditional based upon the count of current user’s published custom posts
- Custom metabox fields not saving when limited to a certain CPT
- Can not hook into custom post type template with: is_page() conditional?
- Diffrent search templates for different post types
- Conditional Tags If Custom Post Parent & Child?
- Custom Post Query Combined with Conditional Tags
- Conditional statement checking two conditions for CPT and Custom Taxonomy [closed]
- strange conditional tag behaviour [duplicate]
- Custom post type is_singular condtional not working when managing sidebar display
- Custom post type: Add “Edit | Quick Edit | Trash | View” links to date (if title is not shown in column)?
- Display custom post type with shortcode
- Restrict custom post type view by user role
- Adding meta values to permalink
- Changing the priority of a custom taxonomy’s metabox
- Adding post tags to custom post types
- How to create a mini directory in WordPress?
- List with categories, subcategories and posts of custom posttype
- Multiple post types in archives (filter?)
- count_many_users_posts except current logged in user?
- Show custom post type randomly in any page
- Common categories for two custom post types
- Shops listing (CPT VS Plugin)
- How can I see a list of my Custom Post Types of the last term I was in?
- Email notification via WP_Mail on published custom post type
- How to store multiple values in 1 meta_key with radio input?
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- How to display “Category and Post_tag” component in a CPT Gutenberg edit screen?
- Custom Post Type not showing in Rest API on Multisite
- Rewrite URL of Custom Post Type for Jobs
- Custom post type’s extra fields – how to handle?
- get_post_types is not showing all registered posts
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Show current custom taxonomy
- Should Custom post types and fields be in the theme files or in a custom plugin packed into the theme?
- Add more than one custom post type to wordpress home page post loop
- Custom capabilities not reflecting on admin panel
- Custom Attachment Type
- custom post type or taxonomy, which approach is better?
- Custom post type, permalink, add query variables problem
- How can I allow users to edit text that will be displayed on a custom post type archive page?
- WordPress is ignoring my post rewrite rule
- Basic CPT Question About Categories
- How to upload an image to a custom post type
- CPT relations use in permalinks under single post type
- Attach a post type to other one
- Creating a custom WP query for a Custom Post Type
- Get queried object for custom post type count
- Redirect Custom Post Type from Child Taxonomies
- put a list of one post type in other post type to select from it and display selected item in second post type’s single page
- Show posts for current taxonomy
- WordPress get all post with like in terms [duplicate]
- Loop multiple taxonomy in custom post
- $post breaking container loop
- Post Meta rows from other types being added to DB regardless of post type
- why get_post_meta is returning 0?
- How to create an upload page (front side)
- Get all active posts that are tied to a custom taxonomy for a custom post type
- Custom archive URL as a subfolder of the custom post type slug
- How can I show a field ID in Elementor with Request Parameter