<?php

    // Get default  mods value.
    $default = nuevo_blog_get_default_mods();

    /// Get default  mods value.
    $author_section_enable = get_theme_mod( 'nuevo_blog_author_section_enable', true );

    if ( false == $author_section_enable ) {
        return;
    }
    $excerpt_length = get_theme_mod( 'nuevo_blog_author_secion_excerpt',20);
    $author_message = get_theme_mod( 'nuevo_blog_author_content_type');
    $top_img_url = get_theme_mod( 'nuevo_blog_author_top_image' );
    $bottom_img_url = get_theme_mod( 'nuevo_blog_author_bottom_image' );

    // Query if the content type is either post or page.
    $author_section_id = get_theme_mod( 'nuevo_blog_author_post',10 );

    $query = new WP_Query( array( 'post_type' => 'post', 'post_per_page' => 1, 'ignore_sticky_posts' => true,  'p' => absint( $author_section_id ) ) ); ?>
       
        <div id="message" class="page-section" >
            <div class="wrapper">
                <?php  
                if ( $query->have_posts() ) {
                    while ( $query->have_posts() ) {
                        $query->the_post(); ?> 
                        <div class="shadow-section-content column-3">
                            <header class="shadow-entry-header">
                                <h2 class="shadow-entry-title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
                            </header> 
                            <?php if ( has_post_thumbnail() ) : ?>
                                <div class="author-thumbnail">
                                    <div class="top-author-image">
                                        <img src="<?php echo esc_url( $top_img_url );?>">
                                    </div>
                                    <div class="main-author-image">
                                        <img src="<?php the_post_thumbnail_url('full'); ?>">
                                    </div>
                                    <div class="bottom-author-image">
                                        <img src="<?php echo esc_url( $bottom_img_url );?>">
                                    </div>
                                </div><!-- .author-thumbnail -->
                            <?php endif; ?>  
                            <div class="shadow-entry-content">
                                <?php
                                    $excerpt = nuevo_blog_the_excerpt( $excerpt_length );
                                    echo wp_kses_post( wpautop( $excerpt ) );
                                ?>
                            </div><!-- .shadow-entry-content -->
                            
                        </div><!-- .shadow-section-content -->
                        <?php 
                    }
                } wp_reset_postdata(); ?>
            </div>
        </div>
