You can get parent page slug and check like
global $post;
$post_data = get_post($post->post_parent);
$parent_slug = $post_data->post_name;
//echo $parent_slug;
if ( !is_page('events') || $parent_slug != 'events') {
Please try and let me know if any query
Related Posts:
- Scripts at the end of the page
- Display a consistent Google Plus icon on ALL pages of my site
- Pass user role to javascript code inside body
- How to use custom Javascript code inside a plugin?
- What’s the default setting for including a in a post
- How to add specific script to WordPress webpage that will working with user input and databases
- Why can I not deregister my style and script on custom post type?
- Adding javascript to header of MetroMagazine theme
- How to set up php,javascript and css to allow for our finished product to be displayed within a page?
- Wondering what these multi-colored extra pages are?
- Create a custom page template inside my wordpress plugin
- Problem in loading javascript in footer
- Overwrite or Replace code in WP_Footer
- JQuery not working in my plugin [closed]
- prettyPhoto media loading very slowly in Chrome
- Add stylesheets and js to template files when shortcode is used
- How to load plugin after page is loaded – pagespeed issues
- add mediaelement.js plugins into WordPress video player control bar
- Shortcode button dosent work for all posts. Work for first post only
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- React JSX in WordPress Plugin Development
- Internationalization autocomplete JS variable
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- View Private Published Page with URL Code (no login required)
- Using custom JS plugins with WordPress?
- Do action only on certain front end pages?
- Override Javascript in a Plugin?
- How to disable specific plugin in mobile version?
- Is there an earlier hook than login_head or login_enqueue_scripts?
- Best approach to fetch data from wp options to js file or php file
- Can someone please tell me what is wrong with my plugin?
- Updating the Drag-To-Share eXtended share URLs?
- wordpress site | All-in-one-cufon IE Issue
- Enqueue WordPress plugin scripts below all other JS
- How to add Internationalization in WordPress using Javascript/React?
- Can I use custom CSS and js plugin to put JavaScript in to validate my forms
- Change upload folder for a CPT
- How to get the element ID from new menu list that added with add_filter()?
- Override Plugin Script Fucnction in WordPress
- Time consuming callbacks in customizer
- How to delete page by deactivating plugin
- WordPress web pages keep getting deleted (moved into the trash) by themselves
- Run plugins only on certain pages
- (FES EDD) New vendor submission page is blank
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- add image crop function like in wp customizer
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- Executing Javascript when a New Post is Published
- Set featured image using javascript in post editor
- Display encrypted content on my website
- Is there a standard way to listen for an on change event of a posts featured image
- How to edit content before post update
- Trying to create a private area custom for each user where they upload images to a server [closed]
- wp.media javascript issue with on select
- WordPress plugin/theme or other wayout to create portable pages?
- WordPress + JavaScipt + AJAX + MySQL: insert query for form
- php page not found for plugin options menu
- add input in custom javascript from WordPress pages/posts
- Advanced AJAX Page Loader ignores other JS code
- How to insert HTML/JavaScript form into WordPress page? [closed]
- Changing page URL and connect newsletter to MailChip
- accessing wp.media api from a tinymce plugin
- Add custom JavaScript that is a combination of CDN/uploaded files and easily-edited code?
- How to load wp_editor via AJAX
- Redux Framework: Page freezes on typing in Editor
- WordPress page and plugin list using sql query
- Create page from plugin, but have it completely hidden
- How to get DEFER or ASYNC attribute to appear when I add a stylesheet with wp_enqueue_style from a plugin? [duplicate]
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- WordPress 3.8.3. custom theme – sliders won’t load js/css files
- Using TinyMCE in plugin?
- Using window.onload with Ubermenu
- How to add subcategories to the blogroll?
- GeoMashup plugin: how to customize cluster markers / icons? [closed]
- How do I write an inventory list plugin that creates dynamic details pages?
- Can I allow certain people to add/edit pages within a parent?
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Proper way to replace the_content only for pages created by custom plugin
- Add menu page issues (permissions & position)
- Add script into front from my plugin
- Redirect to another page using contact form 7? [closed]
- Display Custom Field Value on Admin Page Column
- Would Gutenberg be considered a PlugIn?
- Is there a loading priority for login_enqueue_scripts?
- I need help locating a URL that is on my site map, but that I can’t find in my WordPress dashboard
- Delay JavaScript files from loading
- Show author on every sub-page
- “Conflict” with jQuery (or its plugins)?
- JavaScript in a PHP plugin
- How to have sample page for each new register users in a membership website
- Deactivate JS Script in Plugin Shortcode
- One sub site is slow while all others load fine, same theme & plugins [closed]
- how to prevent all css and javascripts files from loading
- Remove / overwrite some functions in buddypress.js
- wordpress add_action() issue in ajax call
- Register Script in Plugin Widget
- How do I add some javascript validation to the admin interface form’s onsubmit?
- How to create a page with links to other pages that include image and excerpt?
- Localizing methods for jQuery append prepend wrap parent
- How to connect rating to individual comments?