Created
October 11, 2012 17:29
-
-
Save chipbennett/3874106 to your computer and use it in GitHub Desktop.
siiimple_single_meta in single.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
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