Skip to content

Instantly share code, notes, and snippets.

@billrobbins
Created December 5, 2017 15:34
Show Gist options
  • Save billrobbins/cad32a941f0163b226b009293e4cbc76 to your computer and use it in GitHub Desktop.
Save billrobbins/cad32a941f0163b226b009293e4cbc76 to your computer and use it in GitHub Desktop.
<?php
if ( ( is_single() || is_page() || is_singular( 'staff', 'podcast', 'post' ) ) && get_post_meta( $post->ID, 'page_layout', $single = true ) != '' ) {
$layout = get_post_meta( $post->ID, 'page_layout', true );
} else if ( is_home() && ( get_post_meta( get_option( 'page_for_posts' ), 'page_layout', $single = true ) != '' ) ) {
$layout = get_post_meta( get_option( 'page_for_posts' ), 'page_layout', true );
} else {
$layout = get_theme_mod( 'page-layout', 'no-sidebar' );
}
?>
<div id="page-wrap" class="clearfix <?php echo $layout; ?>">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment