You can find the answer on the plugin’s page at wordpress.org. Select the tab ‘Other Notes’. You will find it at the example list:
global $post;
// WP page that is a child of page 77
return in_array(77, get_post_ancestors($post));
Edit: As an alternative to your suggestions you may try
global $post;
return !empty(get_post_ancestors($post));
This is an expensive call and should better be used for testing only. But I suspect that there might be something wrong with your page hierarchy. Is it possible that your top level page is not on root level?
Related Posts:
- conditional tags for the output of a plugin
- Between functions.php (theme), widgets, and plugins, which is loaded first?
- Conditionally enqueue a widget’s script/stylesheet in HEAD (only when present on page!)
- Adding a widget programmatically
- Delete Custom Dashboard Widgets
- Override dynamic_sidebar() in plugin?
- How to pass JavaScript variable to PHP in wordpress widget?
- Is dynamic forms/entries possible in Widget?
- How To Add an Extra Field in All WordPress Available Widgets?
- Has anyone been able to get the aweber plugin to work
- How to create a widget or plugin to add custom content to my website?
- Pages with 2 Columns
- Custom Widget outputs the input but doesn’t save anything inside the textarea
- Custom Widget Creating PHP Exception When Placed In Its Own PHP File
- register child class in another plugin
- Conditional Display of Links in Widgets
- How to Get Admin Settings for a widget when using the_widget() with custom widget
- How to unregister a widget from a child theme
- WordPress multiple widget in single plugin
- Created Widget Not Showing up on Admin Panel
- Setting up widgets in wordpress with a unique ID for the after_title argument
- How to exclude a widget from page 1 of a paginated post
- how can i limit the number of instances for my widget
- Dashboard Widget Form
- Admin Dashboard with Custom Tab for Client
- WordPress author details plugin/widget
- The called constructor method for WP_Widget in GFWidget is deprecated since version 4.3.0! Use
- WAMP to XAMPP WordPress transfer
- How to check if you are on widget.php page?
- The plugin generated 3 characters of unexpected output during activation
- Theme’s default styles are overriding my plugin’s custom CSS
- Rotate Widgets or Content Blocks every x sec/min
- Multi language site [closed]
- How to style the RSS wordpress?
- How can I disable widget from being visible on some pages?
- How to display more than one instance for a widget?
- Custom random quote widget breaks when used in multiple sidebars
- Hooking in to replace the Sidebar/Widget areas
- Do widget options need to be escaped widget()?
- Ajax contact form widget plugin data not insert in database
- How to hide CSS by default and show on button press
- Widgets Scripts don’t load – but load when I reload the page
- How to add wp visual editor in a custom widget?
- WordPress Widget – Saving multidimensional arrays into $instance
- Trying to create a table/list of my EventBrite course listings [closed]
- Call plugin with php function
- Sidebar widget: Randomly select text from a given set
- How do I use add_action on custom widget?
- Repeated Output in Widget
- Exclude posts from widget while post is showing on home, single and categories
- WordPress Apply filter in plugin causes 500 internal error
- Add SideBar/Widgets Just Below the Post
- PHP Warning: Declaration of aec_contributor_list::form() should be compatible with WP_Widget::form($instance)
- Creating a widget and missing jQuery
- strange shortcode error: does shortcodes requires any dependency?
- All custom widgets are not showing in widget area at the same time
- Plugin showing error
- How to set the default value as the saved value once a form of widget is saved?
- Accessing widget information
- Setting text widget to one page only
- How to add captcha to publish widget
- Listing all sidebars
- jQuery slider widget similar to cnet.com
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- Unable to locate inline CSS causing parts of page to be blank
- How to Add text value in Automatically in this conditions?
- Widgets are not displaying in the admin panel
- Elementor pro page editing gives error There has been a critical error on this website. Please check your site admin email inbox for instructions
- Can I add Short Code Of A Plugin In The Code Editor of WordPress?
- Adding custom post category to categories widget
- elementor development – custom widget like an inner section widget
- Update widget values from ajax function
- The styles in the recent posts widgets plugin not working
- How to disable a widget area of a specific page?
- One time call to external API in widget
- Change WordPress plugin widget `id_base` without breaking widget
- Co-author plus: list of posts by authors in the sidebar
- Widget display in theme
- Custom content per post in widget
- Hook on widget context plugin to add custom context for widget
- How to make wp multisite subdomain exist search
- Customize a widget position
- Custom Widget not Available after Plugin Installation
- Adding link on title its in description but not in title see screenshots attached
- How know the “admin” blog from wordpress multisite?
- twitter widget loads properly in all themes except my own theme?
- How can I retrieve data within my widget
- Multiple Plugins Interacting with Menu
- What method should I use for a sidebar widget that reads latest posts?
- WordPress plugin not eching popular posts
- pre-upload text and video for the future
- Last article Widget with text preview and more button
- Scrolling Ads? Live scrolling widget, not random on refresh
- How to add a filter conditionally based on page related Conditional Tags
- Can’t edit Contact Us form on front page
- Sidebar Slideshow widget with text [closed]
- Issue with customizer and widget page
- Footer option is missing in Customiser
- Why my widget is not visible in the WordPress theme Twenty Twenty-Three
- Widget saving but showing “waiting” animation [closed]