Skip to content

Instantly share code, notes, and snippets.

@chipbennett
Created October 11, 2012 17:29
Show Gist options
  • Save chipbennett/3874106 to your computer and use it in GitHub Desktop.
Save chipbennett/3874106 to your computer and use it in GitHub Desktop.
siiimple_single_meta in single.php
/**
Assuming 'no-sidebar' is the fallback/default template to use.
Also, replacing TEMPLATEPATH with get_template_part()
**/
<div class="row">
<?php if ( ! empty( $enable_single ) ) { ?>
<?php get_template_part( '/framework/includes/' . $enable_single ); ?>
<?php } else { ?>
<?php get_template_part( '/framework/includes/no-sidebar.php' ); ?>
<?php } ?>
</div>
/** OR USE THIS **/
<?php $enable_single = ( '' != get_post_meta($post->ID, 'siiimple_single_meta', TRUE) ? get_post_meta($post->ID, 'siiimple_single_meta', TRUE) : 'no-sidebar' ); ?>
<div class="row">
<?php get_template_part( '/framework/includes/' . $enable_single ); ?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment