<?php

/**
 * @Packge     : Daltech
 * @Version    : 1.0
 * @Author     : Daltech
 * @Author URI : https://themeforest.net/user/ModinaTheme/portfolio
 *
 */

// Block direct access
if (!defined('ABSPATH')) {
    exit();
}


// preloader hook function
if (!function_exists('daltech_preloader_wrap_cb')) {
    function daltech_preloader_wrap_cb()
    {
        $preloader_display  =  daltech_opt('daltech_display_preloader');
        if (class_exists('ReduxFramework')) {
            if ($preloader_display) {
                if (defined('ELEMENTOR_VERSION')) {
                    if (\Elementor\Plugin::$instance->preview->is_preview_mode()) {
                        echo '';
                    } else {
                        get_template_part('templates/preloader');
                    }
                } else {
                    get_template_part('templates/preloader');
                }
            }
        }
    }
}

// Header Hook function
if (!function_exists('daltech_header_cb')) {
    function daltech_header_cb()
    {
        get_template_part('templates/header');
        if (!is_404()) {
            get_template_part('templates/header-menu-bottom');
        } else {
            get_template_part('templates/header-menu-bottom');
        }
    }
}

// Blog Start Wrapper Function
if (!function_exists('daltech_blog_start_wrap_cb')) {
    function daltech_blog_start_wrap_cb()
    {

        echo '<div class="blog-wrapper news-wrapper section-padding border-bottom">';
        echo '<div class="container">';
        echo '<div class="news-area">';
        echo '<div class="row">';
    }
}

// Blog End Wrapper Function
if (!function_exists('daltech_blog_end_wrap_cb')) {
    function daltech_blog_end_wrap_cb()
    {
        echo '</div>';
        echo '</div>';
        echo '</div>';
        echo '</div>';
    }
}

// Blog Column Start Wrapper Function
if (!function_exists('daltech_blog_col_start_wrap_cb')) {
    function daltech_blog_col_start_wrap_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_blog_sidebar = daltech_opt('daltech_blog_sidebar');
            $daltech_blog_grid = daltech_opt('daltech_blog_grid');
            if ($daltech_blog_sidebar == '2' && is_active_sidebar('daltech-blog-sidebar')) {
                echo '<div class="col-12 col-lg-8 order-lg-last">';
            } elseif ($daltech_blog_sidebar == '3' && is_active_sidebar('daltech-blog-sidebar')) {
                echo '<div class="col-12 col-lg-8">';
            } else {
                if ($daltech_blog_grid != '1') {
                    echo '<div class="col-12">';
                } else {
                    echo '<div class="col-12 col-lg-10">';
                }
            }
        } else {
            if (is_active_sidebar('daltech-blog-sidebar')) {
                echo '<div class="col-12 col-lg-8">';
            } else {
                echo '<div class="col-12 col-lg-10">';
            }
        }
    }
}
// Blog Column End Wrapper Function
if (!function_exists('daltech_blog_col_end_wrap_cb')) {
    function daltech_blog_col_end_wrap_cb()
    {
        echo '</div>';
    }
}

// Blog Sidebar
if (!function_exists('daltech_blog_sidebar_cb')) {
    function daltech_blog_sidebar_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_blog_sidebar = daltech_opt('daltech_blog_sidebar');
        } else {
            $daltech_blog_sidebar = 2;
        }
        if ($daltech_blog_sidebar != 1 && is_active_sidebar('daltech-blog-sidebar')) {
            // Sidebar
            get_sidebar();
        }
    }
}


if (!function_exists('daltech_blog_details_sidebar_cb')) {
    function daltech_blog_details_sidebar_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_blog_single_sidebar = daltech_opt('daltech_blog_single_sidebar');
        } else {
            $daltech_blog_single_sidebar = 4;
        }
        if ($daltech_blog_single_sidebar != 1) {
            // Sidebar
            get_sidebar();
        }
    }
}

// Blog Pagination Function
if (!function_exists('daltech_blog_pagination_cb')) {
    function daltech_blog_pagination_cb()
    {
        get_template_part('templates/pagination');
    }
}

// Blog Content Function
if (!function_exists('daltech_blog_content_cb')) {
    function daltech_blog_content_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_blog_grid = daltech_opt('daltech_blog_grid');
        } else {
            $daltech_blog_grid = '1';
        }

        if ($daltech_blog_grid == '1') {
            $daltech_blog_grid_class = 'col-lg-12 single-blog-post';
        } elseif ($daltech_blog_grid == '2') {
            $daltech_blog_grid_class = 'col-lg-6 col-md-6 single-blog-post';
        } else {
            $daltech_blog_grid_class = 'col-lg-4 col-md-6 single-blog-post';
        }
        if ($daltech_blog_grid == '1') {
            echo '<div class="blog-posts">';
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    echo '<div class="' . esc_attr($daltech_blog_grid_class) . '">';
                    get_template_part('templates/content', get_post_format());
                    echo '</div>';
                }
                wp_reset_postdata();
            } else {
                get_template_part('templates/content', 'none');
            }
            echo '</div>';
        } else {
            echo '<div class="row">';
            if (have_posts()) {
                while (have_posts()) {
                    the_post();
                    echo '<div class="' . esc_attr($daltech_blog_grid_class) . '">';
                    get_template_part('templates/content', get_post_format());
                    echo '</div>';
                }
                wp_reset_postdata();
            } else {
                get_template_part('templates/content', 'none');
            }
            echo '</div>';
        }
    }
}

// footer content Function
if (!function_exists('daltech_footer_content_cb')) {
    function daltech_footer_content_cb()
    {

        if (class_exists('ReduxFramework') && did_action('elementor/loaded')) {
            if (is_page() || is_page_template('template-builder.php')) {
                $post_id = get_the_ID();

                // Get the page settings manager
                $page_settings_manager = \Elementor\Core\Settings\Manager::get_settings_managers('page');

                // Get the settings model for current post
                $page_settings_model = $page_settings_manager->get_model($post_id);

                // Retrieve the Footer Style
                $footer_settings = $page_settings_model->get_settings('daltech_footer_style');

                // Footer Local
                $footer_local = $page_settings_model->get_settings('daltech_footer_builder_option');

                // Footer Enable Disable
                $footer_enable_disable = $page_settings_model->get_settings('daltech_footer_choice');

                if ($footer_enable_disable == 'yes') {
                    if ($footer_settings == 'footer_builder') {
                        // local options
                        $daltech_local_footer = get_post($footer_local);
                        echo '<footer>';
                        echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display($daltech_local_footer->ID);
                        echo '</footer>';
                    } else {
                        // global options
                        $daltech_footer_builder_trigger = daltech_opt('daltech_footer_builder_trigger');
                        if ($daltech_footer_builder_trigger == 'footer_builder') {
                            echo '<footer>';
                            $daltech_global_footer_select = get_post(daltech_opt('daltech_footer_builder_select'));
                            $footer_post = get_post($daltech_global_footer_select);
                            echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display($footer_post->ID);
                            echo '</footer>';
                        } else {
                            // wordpress widgets
                            daltech_footer_global_option();
                        }
                    }
                }
            } else {
                // global options
                $daltech_footer_builder_trigger = daltech_opt('daltech_footer_builder_trigger');
                if ($daltech_footer_builder_trigger == 'footer_builder') {
                    echo '<footer>';
                    $daltech_global_footer_select = get_post(daltech_opt('daltech_footer_builder_select'));
                    $footer_post = get_post($daltech_global_footer_select);
                    echo \Elementor\Plugin::instance()->frontend->get_builder_content_for_display($footer_post->ID);
                    echo '</footer>';
                } else {
                    // wordpress widgets
                    daltech_footer_global_option();
                }
            }
        } else {
            echo '<footer>';
            echo '<div class="bg-dark">';
            echo '<div class="footer-bottom">';
            echo '<div class="container">';
            echo '<p class="text-center text-light">' . esc_html__('Copyright', 'daltech') . ' <i class="fal fa-copyright"></i> ' . esc_html(date('Y')) . ' <a href="' . esc_url('#') . '">' . esc_html('Daltech', 'daltech') . '</a>' . esc_html__(' All Rights Reserved by', 'daltech') . ' <a href="' . esc_url('#') . '">' . esc_html__('ModinaTheme', 'daltech') . '</a></p>';
            echo '</div>';
            echo '</div>';
            echo '</div>';
            echo '</footer>';
        }
    }
}

// blog details wrapper start hook function
if (!function_exists('daltech_blog_details_wrapper_start_cb')) {
    function daltech_blog_details_wrapper_start_cb()
    {
        echo '<section class="blog-wrapper news-wrapper section-padding border-bottom">';
        echo '<div class="container">';
        echo '<div class="news-area">';
        echo '<div class="row">';
    }
}

// blog details column wrapper start hook function
if (!function_exists('daltech_blog_details_col_start_cb')) {
    function daltech_blog_details_col_start_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_blog_single_sidebar = daltech_opt('daltech_blog_single_sidebar');
            if ($daltech_blog_single_sidebar == '2' && is_active_sidebar('daltech-blog-sidebar')) {
                echo '<div class="col-12 col-lg-8 order-last">';
            } elseif ($daltech_blog_single_sidebar == '3' && is_active_sidebar('daltech-blog-sidebar')) {
                echo '<div class="col-12 col-lg-8">';
            } else {
                echo '<div class="col-lg-10 offset-lg-1">';
            }
        } else {
            if (is_active_sidebar('daltech-blog-sidebar')) {
                echo '<div class="col-lg-8">';
            } else {
                echo '<div class="col-lg-10 offset-lg-1">';
            }
        }
    }
}

// blog details post meta hook function
if (!function_exists('daltech_blog_post_meta_cb')) {
    function daltech_blog_post_meta_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_display_post_date      =  daltech_opt('daltech_display_post_date');
            $daltech_display_post_admin     =  daltech_opt('daltech_display_admin');
            $daltech_display_post_cat      =  daltech_opt('daltech_display_post_cat');
            $daltech_display_post_views     =  daltech_opt('daltech_display_post_views');
        } else {
            $daltech_display_post_date      = '1';
            $daltech_display_post_admin     = '1';
            $daltech_display_post_views     = '';
            $daltech_display_post_cat       = '';
        }

        echo '<!-- Blog Meta -->';
        if (!is_single()) {
            echo '<div class="post-content">';
            echo '<div class="post-meta">';
            daltech_comment_count();
            echo '<span><i class="fal fa-calendar-alt"></i>' . get_the_date('j F, Y') . '</span>';
            echo '</div>';

            if (class_exists('ReduxFramework')) {
                $daltech_excerpt_length = daltech_opt('daltech_blog_postExcerpt');
            } else {
                $daltech_excerpt_length = '45';
            }
            $allowhtml = array(
                'p'         => array(
                    'class'     => array()
                ),
                'span'      => array(),
                'a'         => array(
                    'href'      => array(),
                    'title'     => array()
                ),
                'br'        => array(),
                'em'        => array(),
                'strong'    => array(),
                'b'         => array(),
            );

            if (class_exists('ReduxFramework')) {
                $daltech_blog_admin = daltech_opt('daltech_blog_post_author');

                $daltech_blog_readmore_setting_val = daltech_opt('daltech_blog_readmore_setting');
                if ($daltech_blog_readmore_setting_val == 'custom') {
                    $daltech_blog_readmore_setting = daltech_opt('daltech_blog_custom_readmore');
                } else {
                    $daltech_blog_readmore_setting = __('Read More', 'daltech');
                }
            } else {
                $daltech_blog_readmore_setting = __('Read More', 'daltech');
                $daltech_blog_admin = true;
            }

            echo '<h2><a href="' . esc_url(get_permalink()) . '">' . wp_kses(get_the_title(), $allowhtml) . '</a></h2>';
            echo '<!-- Post Summary -->';
            echo daltech_paragraph_tag(array(
                "text"  => wp_kses(wp_trim_words(get_the_excerpt(), $daltech_excerpt_length, ''), $allowhtml),
            ));
            echo '<!-- End Post Summary -->';
            if ($daltech_blog_admin || !empty($daltech_blog_readmore_setting)) {
                if (!empty($daltech_blog_readmore_setting)) {
                    echo '<!-- Button -->';
                    echo '<a href="' . esc_url(get_permalink()) . '" class="theme-btn mt-4 line-height"><span>' . esc_html($daltech_blog_readmore_setting) . '<i class="fas fa-chevron-right"></i></span></a>';
                    echo '<!-- End Button -->';
                }
            }
            echo '</div>';
        }
    }
}
// Blog Details Post Navigation hook function
if (!function_exists('daltech_blog_details_post_navigation_cb')) {
    function daltech_blog_details_post_navigation_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_post_details_post_navigation = daltech_opt('daltech_post_details_post_navigation');
        } else {
            $daltech_post_details_post_navigation = true;
        }

        $prevpost = get_previous_post();
        $nextpost = get_next_post();

        $allowhtml = array(
            'p'         => array(
                'class'     => array()
            ),
            'span'      => array(),
            'a'         => array(
                'href'      => array(),
                'title'     => array()
            ),
            'br'        => array(),
            'em'        => array(),
            'strong'    => array(),
            'b'         => array(),
        );

        if ($daltech_post_details_post_navigation && !empty($prevpost) || !empty($nextpost)) {

            echo '<div class="post-pagi-area">';
            if (!empty($prevpost)) {
                echo '<div class="post-previous">';
                echo '<a href="' . esc_url(get_permalink($prevpost->ID)) . '"><div class="icon"><i class="fas fa-angle-double-left"></i></div><div class="nav-title">' . esc_html__(' Previous Post', 'daltech') . '<h5>' . wp_trim_words(wp_kses(get_the_title($prevpost->ID), $allowhtml), '2', '') . '</h5></div></a>';
                echo '</div>';
            }
            if (!empty($nextpost)) {
                echo '<div class="post-next">';
                echo '<a href="' . esc_url(get_permalink($nextpost->ID)) . '"><div class="nav-title">' . esc_html__('Next Post ', 'daltech') . '<h5>' . wp_trim_words(wp_kses(get_the_title($nextpost->ID), $allowhtml), '2', '') . '</h5></div> <div class="icon"><i class="fas fa-angle-double-right"></i></div></a>';
                echo '</div>';
            }
            echo '</div>';
        }
    }
}

// blog details share options hook function
if (!function_exists('daltech_blog_details_share_options_cb')) {
    function daltech_blog_details_share_options_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_post_details_share_options = daltech_opt('daltech_post_details_share_options');
        } else {
            $daltech_post_details_share_options = false;
        }
        if (function_exists('daltech_social_sharing_buttons') && $daltech_post_details_share_options) {
            echo '<h4>' . esc_html__('Share:', 'daltech') . '</h4>';
            echo '<div class="social-share">';
            echo daltech_social_sharing_buttons();
            echo '</div>';
            echo '<!-- End Social Share -->';
        }
    }
}

// blog details author bio hook function
if (!function_exists('daltech_blog_details_author_bio_cb')) {
    function daltech_blog_details_author_bio_cb()
    {
        if (class_exists('ReduxFramework')) {
            $postauthorbox =  daltech_opt('daltech_post_details_author_desc_trigger');
        } else {
            $postauthorbox = '1';
        }
        if (!empty(get_the_author_meta('description')) && $postauthorbox == '1') {
            echo '<!-- Start Post Author -->';
            echo '<div class="post-author">';
            echo '<div class="thumb">';
            echo daltech_img_tag(array(
                "url"   => esc_url(get_avatar_url(get_the_author_meta('ID'))),
            ));
            echo '</div>';
            echo '<div class="info">';
            echo daltech_heading_tag(array(
                "tag"   => "h4",
                "text"  => daltech_anchor_tag(array(
                    "text"  => esc_html(ucwords(get_the_author())),
                    "url"   => esc_url(get_author_posts_url(get_the_author_meta('ID'))),
                )),
            ));
            if (!empty(get_the_author_meta('description'))) {
                echo '<p>';
                echo esc_html(get_the_author_meta('description'));
                echo '</p>';
            }
            echo '</div>';
            echo '</div>';
            echo '<!-- Ebd Post Author -->';
        }
    }
}

// Blog Details Comments hook function
if (!function_exists('daltech_blog_details_comments_cb')) {
    function daltech_blog_details_comments_cb()
    {
        if (!comments_open()) {
            echo '<div class="blog-comment-area">';
            echo daltech_heading_tag(array(
                "tag"   => "h3",
                "text"  => esc_html__('Comments are closed', 'daltech'),
                "class" => "inner-title"
            ));
            echo '</div>';
        }

        // comment template.
        if (comments_open() || get_comments_number()) {
            comments_template();
        }
    }
}

// Blog Details Column end hook function
if (!function_exists('daltech_blog_details_col_end_cb')) {
    function daltech_blog_details_col_end_cb()
    {
        echo '</div>';
    }
}

// Blog Details Wrapper end hook function
if (!function_exists('daltech_blog_details_wrapper_end_cb')) {
    function daltech_blog_details_wrapper_end_cb()
    {
        echo '</div>';
        echo '</div>';
        echo '</div>';
        echo '</section>';
    }
}

// page start wrapper hook function
if (!function_exists('daltech_page_start_wrap_cb')) {
    function daltech_page_start_wrap_cb()
    {
        echo '<section class="section-padding">';
        echo '<div class="container">';
        echo '<div class="row">';
    }
}

// page wrapper end hook function
if (!function_exists('daltech_page_end_wrap_cb')) {
    function daltech_page_end_wrap_cb()
    {
        echo '</div>';
        echo '</div>';
        echo '</section>';
    }
}

// page column wrapper start hook function
if (!function_exists('daltech_page_col_start_wrap_cb')) {
    function daltech_page_col_start_wrap_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_page_sidebar = daltech_opt('daltech_page_sidebar');
        } else {
            $daltech_page_sidebar = '1';
        }
        if ($daltech_page_sidebar == '2' && is_active_sidebar('daltech-page-sidebar')) {
            echo '<div class="col-lg-8 order-last">';
        } elseif ($daltech_page_sidebar == '3' && is_active_sidebar('daltech-page-sidebar')) {
            echo '<div class="col-lg-8">';
        } else {
            echo '<div class="col-lg-12">';
        }
    }
}

// page column wrapper end hook function
if (!function_exists('daltech_page_col_end_wrap_cb')) {
    function daltech_page_col_end_wrap_cb()
    {
        echo '</div>';
    }
}

// page sidebar hook function
if (!function_exists('daltech_page_sidebar_cb')) {
    function daltech_page_sidebar_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_page_sidebar = daltech_opt('daltech_page_sidebar');
        } else {
            $daltech_page_sidebar = '1';
        }

        if (class_exists('ReduxFramework')) {
            $daltech_page_layoutopt = daltech_opt('daltech_page_layoutopt');
        } else {
            $daltech_page_layoutopt = '3';
        }

        if ($daltech_page_layoutopt == '1' && $daltech_page_sidebar != 1) {
            get_sidebar('page');
        } elseif ($daltech_page_layoutopt == '2' && $daltech_page_sidebar != 1) {
            get_sidebar();
        }
    }
}

// page content hook function
if (!function_exists('daltech_page_content_cb')) {
    function daltech_page_content_cb()
    {

        echo '<div class="page--content clearfix">';
        the_content();
        // Link Pages
        daltech_link_pages();

        echo '</div>';
        // comment template.
        if (comments_open() || get_comments_number()) {
            comments_template();
        }
    }
}

if (!function_exists('daltech_blog_post_thumb_cb')) {
    function daltech_blog_post_thumb_cb()
    {
        if (get_post_format()) {
            $format = get_post_format();
        } else {
            $format = 'standard';
        }

        $daltech_post_slider_thumbnail = daltech_meta('post_format_slider');

        if (!empty($daltech_post_slider_thumbnail)) {
            echo '<div class="thumb">';
            echo '<div class="blog-slider owl-carousel owl-theme">';
            foreach ($daltech_post_slider_thumbnail as $single_image) {
                if (!is_single()) {
                    echo '<a href="' . esc_url(get_permalink()) . '" class="single-post-image">';
                }
                echo daltech_img_tag(array(
                    'url'   => esc_url($single_image)
                ));
                if (!is_single()) {
                    echo '</a>';
                }
            }
            echo '</div>';
            echo '</div>';
        } elseif (has_post_thumbnail() && $format == 'standard') {
            echo '<!-- Post Thumbnail -->';
            if (!is_single()) {
                echo '<a href="' . esc_url(get_permalink()) . '" class="single-post-image">';
            }
            the_post_thumbnail('daltech_800X400');
            if (!is_single()) {
                echo '</a>';
            }
            echo '<!-- End Post Thumbnail -->';
        } elseif ($format == 'video') {
            if (has_post_thumbnail() && !empty(daltech_meta('post_format_video'))) {
                echo '<div class="thumb responsive-video">';
                if (!is_single()) {
                    echo '<a href="' . esc_url(get_permalink()) . '" class="post-thumbnail">';
                }
                the_post_thumbnail();
                if (!is_single()) {
                    echo '</a>';
                }
                echo '<a href="' . esc_url(daltech_meta('post_format_video')) . '">';
                echo '<i class="fas fa-play"></i>';
                echo '</a>';
                echo '</div>';
            } elseif (!has_post_thumbnail() && !is_single()) {
                echo '<div class="blog-video">';
                if (!is_single()) {
                    echo '<a href="' . esc_url(get_permalink()) . '" class="post-thumbnail">';
                }
                echo daltech_embedded_media(array('video', 'iframe'));
                if (!is_single()) {
                    echo '</a>';
                }
                echo '</div>';
            }
        } elseif ($format == 'audio') {
            $daltech_audio = daltech_meta('post_format_audio');
            if (!empty($daltech_audio)) {
                echo '<div class="thumb audio-post">';
                echo wp_oembed_get($daltech_audio);
                echo '</div>';
            } elseif (!is_single()) {
                echo '<div class="blog-audio blog-img">';
                echo daltech_embedded_media(array('audio', 'iframe'));
                echo '</div>';
            }
        }
    }
}

if (!function_exists('daltech_blog_post_content_cb')) {
    function daltech_blog_post_content_cb()
    {
        $allowhtml = array(
            'p'         => array(
                'class'     => array()
            ),
            'span'      => array(),
            'a'         => array(
                'href'      => array(),
                'title'     => array()
            ),
            'br'        => array(),
            'em'        => array(),
            'strong'    => array(),
            'b'         => array(),
            'sup'       => array(),
            'sub'       => array(),
        );

        // Blog Post Meta
        do_action('daltech_blog_post_meta');
    }
}

if (!function_exists('daltech_blog_postexcerpt_read_content_cb')) {
    function daltech_blog_postexcerpt_read_content_cb()
    {
        if (class_exists('ReduxFramework')) {
            $daltech_excerpt_length = daltech_opt('daltech_blog_postExcerpt');
        } else {
            $daltech_excerpt_length = '45';
        }
        $allowhtml = array(
            'p'         => array(
                'class'     => array()
            ),
            'span'      => array(),
            'a'         => array(
                'href'      => array(),
                'title'     => array()
            ),
            'br'        => array(),
            'em'        => array(),
            'strong'    => array(),
            'b'         => array(),
        );

        if (class_exists('ReduxFramework')) {
            $daltech_blog_admin = daltech_opt('daltech_blog_post_author');

            $daltech_blog_readmore_setting_val = daltech_opt('daltech_blog_readmore_setting');
            if ($daltech_blog_readmore_setting_val == 'custom') {
                $daltech_blog_readmore_setting = daltech_opt('daltech_blog_custom_readmore');
            } else {
                $daltech_blog_readmore_setting = __('Read More', 'daltech');
            }
        } else {
            $daltech_blog_readmore_setting = __('Read More', 'daltech');
            $daltech_blog_admin = true;
        }

        echo '<h2><a href="' . esc_url(get_permalink()) . '">' . wp_kses(get_the_title(), $allowhtml) . '</a></h2>';
        echo '<!-- Post Summary -->';
        echo daltech_paragraph_tag(array(
            "text"  => wp_kses(wp_trim_words(get_the_excerpt(), $daltech_excerpt_length, ''), $allowhtml),
        ));
        echo '<!-- End Post Summary -->';
        if ($daltech_blog_admin || !empty($daltech_blog_readmore_setting)) {
            if (!empty($daltech_blog_readmore_setting)) {
                echo '<!-- Button -->';
                echo '<a href="' . esc_url(get_permalink()) . '" class="theme-btn mt-4 line-height"><span>' . esc_html($daltech_blog_readmore_setting) . '<i class="fas fa-chevron-right"></i></span></a>';
                echo '<!-- End Button -->';
            }
        }
    }
}
