Created
September 3, 2017 06:39
-
-
Save anonymous/7681e58c8ecea014edd47bde30fca4aa to your computer and use it in GitHub Desktop.
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
function yummy_get_about_section_details( $input ) { | |
$options = yummy_get_theme_options(); | |
// about type | |
$about_content_type = $options['about_content_type']; | |
$content = array(); | |
switch ( $about_content_type ) { | |
case 'page': | |
$post_id = null; | |
if ( isset( $options[ 'about_page' ] ) ) { | |
$post_id = $options[ 'about_page' ]; | |
} | |
if ( ! empty( $post_id ) ) { | |
$content['title'] = get_the_title( $post_id ); | |
$content['excerpt'] = get_post_field('post_content', $post_id); | |
} | |
break; | |
} | |
if ( ! empty( $content ) ) { | |
$input = $content; | |
} | |
return $input; | |
} | |
function yummy_render_about_section( $content_details = array() ) { | |
$options = yummy_get_theme_options(); | |
if ( empty( $content_details ) ) { | |
return; | |
} | |
if( ( $options['about_content_type'] == 'page' ) && is_active_sidebar( 'about_section_widget_area' ) ) { | |
$addcolumn = 2; | |
} | |
else { | |
$addcolumn = 1; | |
} | |
?> | |
<section id="reservation-information" class="col-<?php echo $addcolumn; ?>"> | |
<div class="wrapper"> | |
<?php if( is_active_sidebar( 'about_section_widget_area' ) ) { ?> | |
<div class="column-wrapper"> | |
<?php dynamic_sidebar( 'about_section_widget_area' ); ?> | |
</div><!--.column-wrapper--> | |
<?php } ?> | |
<div class="column-wrapper"> | |
<div class="page-section"> | |
<header class="entry-header"> | |
<h2 class="entry-title"><?php echo esc_html( $content_details['title'] ); ?></h2> | |
</header><!--.entry-header--> | |
<?php if( ! empty( $content_details['excerpt'] ) ) { ?> | |
<div class="entry-content"> | |
<p><?php echo wp_kses_post( $content_details['excerpt'] ); ?></p> | |
</div><!--.entry-content--> | |
<?php } ?> | |
</div><!-- .page-section --> | |
</div><!--.column-wrapper--> | |
</div><!--.wrapper--> | |
</section><!--#reservation-form--> | |
<?php } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment