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?
- How to load wp_editor via AJAX
- What is the best page ordering plugin that works well with WPML? [closed]
- How do I only load a plugin js on it’s settings pages?
- How can I change my javascript after it has been enqueued? [closed]
- jQuery plugin only in one page/post
- What happened to convertEntities?
- How to create a Page alias in WordPress
- How to extract images of post and pages excluding header and logo image in wordpress?
- How to avoid redefining requirejs in plugin when another plugin also uses requirejs
- Difference between register_block_type & wp.blocks.registerBlockType
- Automatically adding post and pages to new blog setups
- Can I share predefined fonts from theme_support with a gutenberg component?
- How do I store information in a dynamic block in WordPress?
- W3 Total Cache: Load CSS asynchronously for better PageSpeed score? [closed]
- Pass a php string to a javascript variable
- Problem in loading javascript in footer
- Add stylesheets and js to template files when shortcode is used
- add mediaelement.js plugins into WordPress video player control bar
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- Internationalization autocomplete JS variable
- Is there an earlier hook than login_head or login_enqueue_scripts?
- Can someone please tell me what is wrong with my plugin?
- Enqueue WordPress plugin scripts below all other JS
- Time consuming callbacks in customizer
- Set featured image using javascript in post editor
- Display encrypted content on my website
- Trying to create a private area custom for each user where they upload images to a server [closed]
- Add custom JavaScript that is a combination of CDN/uploaded files and easily-edited code?
- Create page from plugin, but have it completely hidden
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- Using TinyMCE in plugin?
- How to add subcategories to the blogroll?
- I need help locating a URL that is on my site map, but that I can’t find in my WordPress dashboard
- Deactivate JS Script in Plugin Shortcode
- Remove / overwrite some functions in buddypress.js
- Minimizing scripts & css files that plugins add
- Add Content to Content()
- Add type to enqueued script inside plugin
- After updating the WordPress getting a syntax error in the console
- coding a WordPress AJAX Form using PHP to check if User is Logged Out and Show error
- Conditional custom redirect
- Change website directory safely to add a static page on startup
- Price comparison table based on Custom Post Type?
- Meta slider plugin only works after first refresh – Object has no method ‘flex slider’
- Load CSS files in header of Bones theme?
- How to dynamically change spots of text in custom page?
- How to enqueue some javascript source once per page
- JS Plugin not executing the js correctly. Trying to make all internal links scroll smoothly
- Call javascript functions from each page
- Javascript from Easy-Fancybox place into footer
- Pasting this PHP breaks my page. Why?
- uncaught TypeError: Cannot read properties of null (reading ‘classList’) custom plugin
- How do I minify a plugins CSS/JS code?
- Woocommerce checkout page broken when set as a checkout in woocommerce settings [closed]
- Directorist – Dropdown doesn’t open
- Javascript fetch on wordpress plugins not working
- Jquery POST Ajax Return null data in wordpress
- How to apply to hide TinyMCE (wp_editor) on button click
- Validating ajax search
- Overriding inline !important CSS with Javscript code snippet with media query
- Add style to body based on url
- WordPress Frontend Page using Plugin
- Ajax Call not Working in Plugin
- How to create a custom block in Gutenberg with multiple checkboxes?
- Website always load twice on start
- Multiple image selection custom widget
- Execute inline javascript in wordpress after page fully loaded
- Javascript inserted from Plugin pointing to wrong location
- Speeding up WordPress on a Local Network
- How to use information from the database in the front-end?
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- How to disable users to view Other pages
- Number format in thousands on highcharts in wpdatatable plugin
- Disqus comments count taking long to update
- Get content and send to 3rd party
- Multiple calling javascript from shortcode in one page
- Embed Javascript code to registered users only
- History of page, interval of years
- Choose default template for a page with code
- Best use adding user generated JS/CSS to a theme with a plugin
- Run one-time script calling plugin functions
- Get page content by ID (from a plugin)
- Ajax, jQuery and WordPress
- Display static pages instead of category, in code
- Move specific javascript to the footer
- Eliminate Render blocking CSS?
- Additional scrollbar appears inside the browser on every page + lag scroll -Winner theme
- How to make a rest style plugin?
- How can I include properly javascript files in my wp plugin [duplicate]
- Adding a script & php to functions.php
- how to show selected options drop down menu values in attributes field in after saving post.php