<?php
/**
 * Header Content section
 *
 * This is the template for the content of header-content section
 *
 * @package Theme Palace
 * @subpackage Kompany
 * @since Kompany 1.0.0
 */
if ( ! function_exists( 'kompany_add_header_content_section' ) ) :
    /**
    * Add header-content section
    *
    *@since Kompany 1.0.0
    */
    function kompany_add_header_content_section() {
        $options = kompany_get_theme_options();
        // Check if header-content is enabled on frontpage
        $header_content_enable = apply_filters( 'kompany_section_status', true, 'header_content_section_enable' );

        if ( true !== $header_content_enable ) {
            return false;
        }

        // Render header-content section now.
        kompany_render_header_content_section();
    }
endif;

if ( ! function_exists( 'kompany_render_header_content_section' ) ) :
  /**
   * Start header-content section
   *
   * @return string header-content content
   * @since Kompany 1.0.0
   *
   */
   function kompany_render_header_content_section() {
        $options = kompany_get_theme_options();
        $subtitle = !empty( $options['header_content_sub_title'] ) ? $options['header_content_sub_title'] : '';
        $title = !empty( $options['header_content_title'] ) ? $options['header_content_title'] : '';
        ?>
        
        <div id="kompany_header_content_section">
          <div class="wrapper">
            <div class="section-header">

              <?php if( !empty( $subtitle ) ): ?>
                <p class="section-subtitle"><?php echo esc_html( $subtitle ); ?></p>
              <?php endif;

              if( !empty( $title ) ): ?>
              <h2 class="section-title"><?php echo esc_html( $title ); ?></h2>
            <?php endif; ?>

          </div><!-- .section-header -->
        </div><!-- .wrapper -->
      </div><!-- #header-content -->
            
    <?php }
endif;