Conditional tag in Widget Logic for checking if top level page or if subpage
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 … Read more