Skip to content

Instantly share code, notes, and snippets.

@whyisjake
Created February 19, 2013 03:58
Show Gist options
  • Save whyisjake/4982977 to your computer and use it in GitHub Desktop.
Save whyisjake/4982977 to your computer and use it in GitHub Desktop.
Conditional to see if a post has a parent. If it does, show the sidebar-custom.php, if not, just show sidebar.php.
<?php
if($post->post_parent !== 0) {
get_sidebar( 'custom' );
} else {
get_sidebar();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment