<?php
/**
 * @package Lawyer Consultant
 */

/**
 * Footer
 */
if (! function_exists( 'lawyer_consultant_footer_copyrights' ) ):
    function lawyer_consultant_footer_copyrights() {
        ?>
            <div class="row">
                <div class="copyrights">
                    <p>
                        <?php
                            if("" != esc_html(get_theme_mod( 'lawyer_consultant_footer_copyright_text'))) :
                                echo esc_html(get_theme_mod( 'lawyer_consultant_footer_copyright_text'));
                                if(get_theme_mod('lawyer_consultant_en_footer_credits',true)) :
                                    ?>
                                    <span class="copyrg-link"><a href="<?php echo esc_url(LAWYER_CONSULTANT_AUT); ?>" target="_blank" rel="nofollow noopener"><?php esc_html_e(' | Lawyer WordPress Theme','lawyer-consultant') ?></a><?php esc_html_e(' by Legacy Themes','lawyer-consultant') ?></span>
                                    <?php   
                                endif;
                            else :
                                echo date_i18n(
                                    /* translators: Copyright date format, see https://secure.php.net/date */
                                    _x( 'Y', 'copyright date format', 'lawyer-consultant' )
                                );
                                ?>
                                    <a href="<?php echo esc_url( home_url( '/' ) ); ?>"><?php bloginfo( 'name' ); ?></a>
                                    <span class="copyrg-link"><a href="<?php echo esc_url(LAWYER_CONSULTANT_AUT); ?>" target="_blank" rel="nofollow noopener"><?php esc_html_e(' | Lawyer WordPress Theme','lawyer-consultant') ?></a><?php esc_html_e(' by Legacy Themes','lawyer-consultant') ?></span>
                                <?php
                            endif;
                        ?>
                    </p>
                </div>
            </div>
        <?php    
    }
endif;
add_action( 'lawyer_consultant_action_footer', 'lawyer_consultant_footer_copyrights' );

/**
 * Page Title Settings
 */
if (!function_exists('lawyer_consultant_show_page_title')) :
    function lawyer_consultant_show_page_title() {
        if (!is_front_page()) {
            ?>
            <div class="page-title"> 
                <div class="content-section img-overlay">
                    <div class="container">
                        <div class="row text-center">
                            <div class="col-md-12">
                                <div class="section-title"> 
                                    <?php
                                    if (is_singular('post')) {
                                        // Single blog post
                                        echo '<h1 class="main-title">' . get_the_title() . '</h1>';
                                    } elseif (is_category()) {
                                        echo '<h1 class="main-title">' . single_cat_title('', false) . '</h1>';
                                    } elseif (is_tag()) {
                                        echo '<h1 class="main-title">' . single_tag_title('', false) . '</h1>';
                                    } elseif (is_author()) {
                                        echo '<h1 class="main-title">' . get_the_author() . '</h1>';
                                    } elseif (is_archive()) {
                                        echo '<h1 class="main-title">' . get_the_archive_title() . '</h1>';
                                    } elseif (is_search()) {
                                        echo '<h1 class="main-title">' . esc_html__('Search Results', 'lawyer-consultant') . '</h1>';
                                    } elseif (is_404()) {
                                        echo '<h1 class="main-title">' . esc_html__('Page Not Found', 'lawyer-consultant') . '</h1>';
                                    } else {
                                        echo '<h1 class="main-title">' . get_the_title() . '</h1>';
                                    }
                                    ?>
                                </div>                      
                            </div>
                        </div>
                    </div>  
                </div>
            </div>  <!-- End page-title --> 
            <?php
        }
    }
endif;


/**
 * Home Banner Section
 */
if (! function_exists( 'lawyer_consultant_home_banner_section' ) ):
    function lawyer_consultant_home_banner_section() {
        ?>
        <section id="main-banner-wrap">
            <div class="banner-side-margin position-relative">
                <div class="main-banner-inner-box">
                    <?php
                    $lawyer_consultant_banner_image = get_theme_mod( 'lawyer_consultant_banner_image', '' );
                    if ( ! empty( $lawyer_consultant_banner_image ) ) { ?>
                        <img src="<?php echo esc_url( $lawyer_consultant_banner_image ); ?>">
                    <?php } ?>
                </div>
                <?php
                $lawyer_consultant_alignment_class = get_theme_mod( 'lawyer_consultant_slider_content_alignment', 'left' );
                ?>
                <div class="main-banner-content-box content-<?php echo esc_attr( $lawyer_consultant_alignment_class ); ?>">
                    <?php
                        $lawyer_consultant_banner_heading = get_theme_mod( 'lawyer_consultant_banner_heading', '' );
                        if ( ! empty( $lawyer_consultant_banner_heading ) ) { ?>
                        <h3><?php echo esc_html( $lawyer_consultant_banner_heading ); ?></h3>
                    <?php } ?>
                    <?php
                        $lawyer_consultant_banner_text = get_theme_mod( 'lawyer_consultant_banner_text', '' );
                        if ( ! empty( $lawyer_consultant_banner_text ) ) { ?>
                        <p><?php echo esc_html( $lawyer_consultant_banner_text ); ?></p>
                    <?php } ?>
                    <div class="banner-button">
                        <?php
                        $lawyer_consultant_banner_button_link = get_theme_mod( 'lawyer_consultant_banner_button_link', '' );
                        if ( ! empty( $lawyer_consultant_banner_button_link ) ) { ?>
                            <a href="<?php echo esc_url( $lawyer_consultant_banner_button_link ); ?>"><?php echo esc_html('Get A Quote','lawyer-consultant'); ?></a>
                        <?php } ?>
                    </div>                            
                </div>
            </div>
        </section>
        <?php
    }
endif;
add_action( 'lawyer_consultant_action_home_banner', 'lawyer_consultant_home_banner_section' );

/**
 * Home About Section
 */
if (! function_exists( 'lawyer_consultant_home_about_section' ) ):
    function lawyer_consultant_home_about_section() {
        ?>
        <section id="about-wrap" class="py-5">
            <div class="container">
                <div class="row align-items-center inner-project">
                    <div class="col-lg-4 col-md-12 col-12 align-self-center p-0">
                        <div class="inner-about-image">
                            <?php
                            $lawyer_consultant_about_image = get_theme_mod( 'lawyer_consultant_about_image', '' );
                            if ( ! empty( $lawyer_consultant_about_image ) ) { ?>
                                <img class="about-image" src="<?php echo esc_url( $lawyer_consultant_about_image ); ?>">
                            <?php } ?>
                        </div>
                    </div>
                    <div class="col-lg-8 col-md-12 col-12 align-self-center p-4 outer-project">
                        <div class="inner-project-box mb-lg-0 mb-md-0 mb-4">
                            <div class="row">
                                <div class="col-md-5 align-self-center">
                                    <?php
                                        $lawyer_consultant_about_image1 = get_theme_mod( 'lawyer_consultant_about_image1', '' );
                                        if ( ! empty( $lawyer_consultant_about_image1 ) ) { ?>
                                            <img class="abt-inn" src="<?php echo esc_url( $lawyer_consultant_about_image1 ); ?>">
                                    <?php } ?>
                                </div>
                                <div class="col-md-7 align-self-center p-3">
                                    <?php
                                        $lawyer_consultant_about_heading1 = get_theme_mod( 'lawyer_consultant_about_heading1', '' );
                                        if ( ! empty( $lawyer_consultant_about_heading1 ) ) { ?>
                                        <h3><?php echo esc_html( $lawyer_consultant_about_heading1 ); ?></h3>
                                    <?php } ?>
                                    <?php
                                        $lawyer_consultant_about_content1 = get_theme_mod( 'lawyer_consultant_about_content1', '' );
                                        if ( ! empty( $lawyer_consultant_about_content1 ) ) { ?>
                                        <p><?php echo esc_html( $lawyer_consultant_about_content1 ); ?></p>
                                    <?php } ?>
                                    <?php
                                        $lawyer_consultant_about_price1 = get_theme_mod( 'lawyer_consultant_about_price1', '' );
                                        if ( ! empty( $lawyer_consultant_about_price1 ) ) { ?>
                                        <h4><?php echo esc_html( $lawyer_consultant_about_price1 ); ?></h4>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                        <div class="inner-project-box mb-lg-0 mb-md-0 mb-4">
                            <div class="row">
                                <div class="col-md-5 align-self-center">
                                    <?php
                                        $lawyer_consultant_about_image2 = get_theme_mod( 'lawyer_consultant_about_image2', '' );
                                        if ( ! empty( $lawyer_consultant_about_image2 ) ) { ?>
                                            <img class="abt-inn" src="<?php echo esc_url( $lawyer_consultant_about_image2 ); ?>">
                                    <?php } ?>
                                </div>
                                <div class="col-md-7 align-self-center p-3">
                                    <?php
                                        $lawyer_consultant_about_heading2 = get_theme_mod( 'lawyer_consultant_about_heading2', '' );
                                        if ( ! empty( $lawyer_consultant_about_heading2 ) ) { ?>
                                        <h3><?php echo esc_html( $lawyer_consultant_about_heading2 ); ?></h3>
                                    <?php } ?>
                                    <?php
                                        $lawyer_consultant_about_content2 = get_theme_mod( 'lawyer_consultant_about_content2', '' );
                                        if ( ! empty( $lawyer_consultant_about_content2 ) ) { ?>
                                        <p><?php echo esc_html( $lawyer_consultant_about_content2 ); ?></p>
                                    <?php } ?>
                                    <?php
                                        $lawyer_consultant_about_price2 = get_theme_mod( 'lawyer_consultant_about_price2', '' );
                                        if ( ! empty( $lawyer_consultant_about_price2 ) ) { ?>
                                        <h4><?php echo esc_html( $lawyer_consultant_about_price2 ); ?></h4>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                        <div class="inner-project-box mb-lg-0 mb-md-0 mb-4">
                            <div class="row">
                                <div class="col-md-5 align-self-center">
                                    <?php
                                        $lawyer_consultant_about_image3 = get_theme_mod( 'lawyer_consultant_about_image3', '' );
                                        if ( ! empty( $lawyer_consultant_about_image3 ) ) { ?>
                                            <img class="abt-inn" src="<?php echo esc_url( $lawyer_consultant_about_image3 ); ?>">
                                    <?php } ?>
                                </div>
                                <div class="col-md-7 align-self-center p-3">
                                    <?php
                                        $lawyer_consultant_about_heading3 = get_theme_mod( 'lawyer_consultant_about_heading3', '' );
                                        if ( ! empty( $lawyer_consultant_about_heading3 ) ) { ?>
                                        <h3><?php echo esc_html( $lawyer_consultant_about_heading3 ); ?></h3>
                                    <?php } ?>
                                    <?php
                                        $lawyer_consultant_about_content3 = get_theme_mod( 'lawyer_consultant_about_content3', '' );
                                        if ( ! empty( $lawyer_consultant_about_content3 ) ) { ?>
                                        <p><?php echo esc_html( $lawyer_consultant_about_content3 ); ?></p>
                                    <?php } ?>
                                    <?php
                                        $lawyer_consultant_about_price3 = get_theme_mod( 'lawyer_consultant_about_price3', '' );
                                        if ( ! empty( $lawyer_consultant_about_price3 ) ) { ?>
                                        <h4><?php echo esc_html( $lawyer_consultant_about_price3 ); ?></h4>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                        <div class="inner-project-box mb-lg-0 mb-md-0 mb-4">
                            <div class="row">
                                <div class="col-md-5 align-self-center">
                                    <?php
                                        $lawyer_consultant_about_image4 = get_theme_mod( 'lawyer_consultant_about_image4', '' );
                                        if ( ! empty( $lawyer_consultant_about_image4 ) ) { ?>
                                            <img class="abt-inn" src="<?php echo esc_url( $lawyer_consultant_about_image4 ); ?>">
                                    <?php } ?>
                                </div>
                                <div class="col-md-7 align-self-center p-3">
                                    <?php
                                        $lawyer_consultant_about_heading4 = get_theme_mod( 'lawyer_consultant_about_heading4', '' );
                                        if ( ! empty( $lawyer_consultant_about_heading4 ) ) { ?>
                                        <h3><?php echo esc_html( $lawyer_consultant_about_heading4 ); ?></h3>
                                    <?php } ?>
                                    <?php
                                        $lawyer_consultant_about_content4 = get_theme_mod( 'lawyer_consultant_about_content4', '' );
                                        if ( ! empty( $lawyer_consultant_about_content4 ) ) { ?>
                                        <p><?php echo esc_html( $lawyer_consultant_about_content4 ); ?></p>
                                    <?php } ?>
                                    <?php
                                        $lawyer_consultant_about_price4 = get_theme_mod( 'lawyer_consultant_about_price4', '' );
                                        if ( ! empty( $lawyer_consultant_about_price4 ) ) { ?>
                                        <h4><?php echo esc_html( $lawyer_consultant_about_price4 ); ?></h4>
                                    <?php } ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <?php    
    }
endif;
add_action( 'lawyer_consultant_action_home_about', 'lawyer_consultant_home_about_section' );

/**
 * Home page another adding Section
 */
if (! function_exists( 'lawyer_consultant_home_extra_section' ) ):
    function lawyer_consultant_home_extra_section() {
        ?>
        <div id="custom-home-extra-content" class="py-3">
            <div class="container">
              <?php while ( have_posts() ) : the_post(); ?>
                <?php the_content(); ?>
              <?php endwhile; ?>
            </div>
        </div>
        <?php    
    }
endif;
add_action( 'lawyer_consultant_action_home_extra', 'lawyer_consultant_home_extra_section' );