WordPress.org

Support

Support » Miscellaneous » Sidebar depending on URL/subpages

Sidebar depending on URL/subpages

Viewing 1 replies (of 1 total)
  • Something like this would work:

    $ancestors = get_post_ancestors( $post->ID );
    $root_parent = 15;
    
    if( in_array( $root_parent, $ancestors ) )
    	# DO STUFF
Viewing 1 replies (of 1 total)
  • The topic ‘Sidebar depending on URL/subpages’ is closed to new replies.