<?php
/**
 * Custom Functions.
 *
 * @package Omega Blogger
 */

if( !function_exists( 'omega_blogger_fonts_url' ) ) :

    //Google Fonts URL
    function omega_blogger_fonts_url(){

        $omega_blogger_font_families = array(
            'IBM+Plex+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700',
        );

        $omega_blogger_fonts_url = add_query_arg( array(
            'family' => implode( '&family=', $omega_blogger_font_families ),
            'display' => 'swap',
        ), 'https://fonts.googleapis.com/css2' );

        return esc_url_raw($omega_blogger_fonts_url);
    }

endif;

if ( ! function_exists( 'omega_blogger_sub_menu_toggle_button' ) ) :

    function omega_blogger_sub_menu_toggle_button( $omega_blogger_args, $omega_blogger_item, $depth ) {

        // Add sub menu toggles to the main menu with toggles
        if ( $omega_blogger_args->theme_location == 'omega-blogger-primary-menu' && isset( $omega_blogger_args->show_toggles ) ) {
            
            // Wrap the menu item link contents in a div, used for positioning
            $omega_blogger_args->before = '<div class="submenu-wrapper">';
            $omega_blogger_args->after  = '';

            // Add a toggle to items with children
            if ( in_array( 'menu-item-has-children', $omega_blogger_item->classes ) ) {

                $omega_blogger_toggle_target_string = '.menu-item.menu-item-' . $omega_blogger_item->ID . ' > .sub-menu';

                // Add the sub menu toggle
                $omega_blogger_args->after .= '<button type="button" class="theme-aria-button submenu-toggle" data-toggle-target="' . $omega_blogger_toggle_target_string . '" data-toggle-type="slidetoggle" data-toggle-duration="250" aria-expanded="false"><span class="btn__content" tabindex="-1"><span class="screen-reader-text">' . esc_html__( 'Show sub menu', 'omega-blogger' ) . '</span>' . omega_blogger_get_theme_svg( 'chevron-down' ) . '</span></button>';

            }

            // Close the wrapper
            $omega_blogger_args->after .= '</div><!-- .submenu-wrapper -->';
            // Add sub menu icons to the main menu without toggles (the fallback menu)

        }elseif( $omega_blogger_args->theme_location == 'omega-blogger-primary-menu' ) {

            if ( in_array( 'menu-item-has-children', $omega_blogger_item->classes ) ) {

                $omega_blogger_args->before = '<div class="link-icon-wrapper">';
                $omega_blogger_args->after  = omega_blogger_get_theme_svg( 'chevron-down' ) . '</div>';

            } else {

                $omega_blogger_args->before = '';
                $omega_blogger_args->after  = '';

            }

        }

        return $omega_blogger_args;

    }

endif;

add_filter( 'nav_menu_item_args', 'omega_blogger_sub_menu_toggle_button', 10, 3 );

if ( ! function_exists( 'omega_blogger_the_theme_svg' ) ):
    
    function omega_blogger_the_theme_svg( $omega_blogger_svg_name, $omega_blogger_return = false ) {

        if( $omega_blogger_return ){

            return omega_blogger_get_theme_svg( $omega_blogger_svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in omega_blogger_get_theme_svg();.

        }else{

            echo omega_blogger_get_theme_svg( $omega_blogger_svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in omega_blogger_get_theme_svg();.

        }
    }

endif;

if ( ! function_exists( 'omega_blogger_get_theme_svg' ) ):

    function omega_blogger_get_theme_svg( $omega_blogger_svg_name ) {

        // Make sure that only our allowed tags and attributes are included.
        $omega_blogger_svg = wp_kses(
            Omega_Blogger_SVG_Icons::get_svg( $omega_blogger_svg_name ),
            array(
                'svg'     => array(
                    'class'       => true,
                    'xmlns'       => true,
                    'width'       => true,
                    'height'      => true,
                    'viewbox'     => true,
                    'aria-hidden' => true,
                    'role'        => true,
                    'focusable'   => true,
                ),
                'path'    => array(
                    'fill'      => true,
                    'fill-rule' => true,
                    'd'         => true,
                    'transform' => true,
                ),
                'polygon' => array(
                    'fill'      => true,
                    'fill-rule' => true,
                    'points'    => true,
                    'transform' => true,
                    'focusable' => true,
                ),
                'polyline' => array(
                    'fill'      => true,
                    'points'    => true,
                ),
                'line' => array(
                    'fill'      => true,
                    'x1'      => true,
                    'x2' => true,
                    'y1'    => true,
                    'y2' => true,
                ),
            )
        );
        if ( ! $omega_blogger_svg ) {
            return false;
        }
        return $omega_blogger_svg;

    }

endif;

if( !function_exists( 'omega_blogger_post_category_list' ) ) :

    // Post Category List.
    function omega_blogger_post_category_list( $omega_blogger_select_cat = true ){

        $omega_blogger_post_cat_lists = get_categories(
            array(
                'hide_empty' => '0',
                'exclude' => '1',
            )
        );

        $omega_blogger_post_cat_cat_array = array();
        if( $omega_blogger_select_cat ){

            $omega_blogger_post_cat_cat_array[''] = esc_html__( '-- Select Category --','omega-blogger' );

        }

        foreach ( $omega_blogger_post_cat_lists as $omega_blogger_post_cat_list ) {

            $omega_blogger_post_cat_cat_array[$omega_blogger_post_cat_list->slug] = $omega_blogger_post_cat_list->name;

        }

        return $omega_blogger_post_cat_cat_array;
    }

endif;

if( !function_exists('omega_blogger_single_post_navigation') ):

    function omega_blogger_single_post_navigation(){

        $omega_blogger_single_post_navigation = omega_blogger_get_default_theme_options();
        $omega_blogger_twp_navigation_type = esc_attr( get_post_meta( get_the_ID(), 'omega_blogger_twp_disable_ajax_load_next_post', true ) );
        $omega_blogger_current_id = '';
        $article_wrap_class = '';
        global $post;
        $omega_blogger_current_id = $post->ID;
        if( $omega_blogger_twp_navigation_type == '' || $omega_blogger_twp_navigation_type == 'global-layout' ){
            $omega_blogger_twp_navigation_type = get_theme_mod('omega_blogger_twp_navigation_type', $omega_blogger_single_post_navigation['omega_blogger_twp_navigation_type']);
        }

        if( $omega_blogger_twp_navigation_type != 'no-navigation' && 'post' === get_post_type() ){

            if( $omega_blogger_twp_navigation_type == 'theme-normal-navigation' ){ ?>

                <div class="navigation-wrapper">
                    <?php
                    // Previous/next post navigation.
                    the_post_navigation(array(
                        'prev_text' => '<span class="arrow" aria-hidden="true">' . omega_blogger_the_theme_svg('arrow-left',$omega_blogger_return = true ) . '</span><span class="screen-reader-text">' . esc_html__('Previous post:', 'omega-blogger') . '</span><span class="post-title">%title</span>',
                        'next_text' => '<span class="arrow" aria-hidden="true">' . omega_blogger_the_theme_svg('arrow-right',$omega_blogger_return = true ) . '</span><span class="screen-reader-text">' . esc_html__('Next post:', 'omega-blogger') . '</span><span class="post-title">%title</span>',
                    )); ?>
                </div>
                <?php

            }else{

                $omega_blogger_next_post = get_next_post();
                if( isset( $omega_blogger_next_post->ID ) ){

                    $omega_blogger_next_post_id = $omega_blogger_next_post->ID;
                    echo '<div loop-count="1" next-post="' . absint( $omega_blogger_next_post_id ) . '" class="twp-single-infinity"></div>';

                }
            }

        }

    }

endif;

add_action( 'omega_blogger_navigation_action','omega_blogger_single_post_navigation',30 );

if( !function_exists('omega_blogger_content_offcanvas') ):

    // Offcanvas Contents
    function omega_blogger_content_offcanvas(){ ?>

        <div id="offcanvas-menu">
            <div class="offcanvas-wraper">
                <div class="close-offcanvas-menu">
                    <div class="offcanvas-close">
                        <a href="javascript:void(0)" class="skip-link-menu-start"></a>
                        <button type="button" class="button-offcanvas-close">
                            <span class="offcanvas-close-label">
                                <?php echo esc_html__('Close', 'omega-blogger'); ?>
                            </span>
                        </button>
                    </div>
                </div>
                <div id="primary-nav-offcanvas" class="offcanvas-item offcanvas-main-navigation">
                    <nav class="primary-menu-wrapper" aria-label="<?php esc_attr_e('Horizontal', 'omega-blogger'); ?>" role="navigation">
                        <ul class="primary-menu theme-menu">
                            <?php
                            if (has_nav_menu('omega-blogger-primary-menu')) {
                                wp_nav_menu(
                                    array(
                                        'container' => '',
                                        'items_wrap' => '%3$s',
                                        'theme_location' => 'omega-blogger-primary-menu',
                                        'show_toggles' => true,
                                    )
                                );
                            }else{

                                wp_list_pages(
                                    array(
                                        'match_menu_classes' => true,
                                        'show_sub_menu_icons' => true,
                                        'title_li' => false,
                                        'show_toggles' => true,
                                        'walker' => new Omega_Blogger_Walker_Page(),
                                    )
                                );
                            }
                            ?>
                        </ul>
                    </nav><!-- .primary-menu-wrapper -->
                </div>
                <a href="javascript:void(0)" class="skip-link-menu-end"></a>
            </div>
        </div>

    <?php
    }

endif;

add_action( 'omega_blogger_before_footer_content_action','omega_blogger_content_offcanvas',30 );

if( !function_exists('omega_blogger_footer_content_widget') ):

    function omega_blogger_footer_content_widget(){
        
        $omega_blogger_default = omega_blogger_get_default_theme_options();
        
        $omega_blogger_footer_column_layout = absint(get_theme_mod('omega_blogger_footer_column_layout', $omega_blogger_default['omega_blogger_footer_column_layout']));
        $omega_blogger_footer_sidebar_class = 12;
        
        if($omega_blogger_footer_column_layout == 2) {
            $omega_blogger_footer_sidebar_class = 6;
        }
        
        if($omega_blogger_footer_column_layout == 3) {
            $omega_blogger_footer_sidebar_class = 4;
        }
        ?>
        
        <?php if ( get_theme_mod('omega_blogger_display_footer', true) == true ) : ?>
            <div class="footer-widgetarea">
                <div class="wrapper">
                    <div class="column-row">
                    
                        <?php for ($i = 0; $i < $omega_blogger_footer_column_layout; $i++) : ?>
                            
                            <div class="column <?php echo 'column-' . absint($omega_blogger_footer_sidebar_class); ?> column-sm-12">
                                
                                <?php 
                                // If no widgets are assigned, display default widgets
                                if ( ! is_active_sidebar( 'omega-blogger-footer-widget-' . $i ) ) : 

                                    if ($i === 0) : ?>
                                        <div id="media_image-3" class="widget widget_media_image">
                                            <img src="<?php echo esc_url(get_template_directory_uri() . '/assets/images/logo.png'); ?>" alt="<?php echo esc_attr__( 'Footer Image', 'omega-blogger' ); ?>" style="max-width: 100%; height: auto;">
                                        </div>
                                        <div id="text-3" class="widget widget_text">
                                            <div class="textwidget">
                                                <p class="widget_text">
                                                    <?php esc_html_e('Omega Blogger is a versatile and professional WordPress theme designed to cater to the needs of bloggers, blogging tips, content creation, lifestyle blogger, travel blog, food blog, fashion blogging, personal blog, SEO for blogs, blog monetization, social media promotion, blog writing, blogger outreach, influencer marketing, blog design, blog themes, niche blogging, guest blogging, blog traffic, online community, blogging tools, affiliate marketing...', 'omega-blogger'); ?>
                                                </p>
                                            </div>
                                        </div>

                                    <?php elseif ($i === 1) : ?>
                                        <div id="pages-2" class="widget widget_pages">
                                            <h2 class="widget-title"><?php esc_html_e('Calendar', 'omega-blogger'); ?></h2>
                                            <?php get_calendar(); ?>
                                        </div>

                                    <?php elseif ($i === 2) : ?>
                                        <div id="search-2" class="widget widget_search">
                                            <h2 class="widget-title"><?php esc_html_e('Enter Keywords Here', 'omega-blogger'); ?></h2>
                                            <?php get_search_form(); ?>
                                        </div>
                                    <?php endif; 
                                    
                                else :
                                    // Display dynamic sidebar widget if assigned
                                    dynamic_sidebar('omega-blogger-footer-widget-' . $i);
                                endif;
                                ?>
                                
                            </div>
                            
                        <?php endfor; ?>

                    </div>
                </div>
            </div>
        <?php endif; ?> 

    <?php
    }

endif;

add_action( 'omega_blogger_footer_content_action', 'omega_blogger_footer_content_widget', 10 );

if( !function_exists('omega_blogger_footer_content_info') ):

    /**
     * Footer Copyright Area
    **/
    function omega_blogger_footer_content_info(){

        $omega_blogger_footer_content_info = omega_blogger_get_default_theme_options(); ?>
        <div class="site-info">
            <div class="wrapper">
                <div class="column-row">
                    <div class="column column-9">
                        <div class="footer-credits">
                            <div class="footer-copyright">
                                <?php
                                $omega_blogger_footer_copyright_text = wp_kses_post( get_theme_mod( 'omega_blogger_footer_copyright_text', $omega_blogger_footer_content_info['omega_blogger_footer_copyright_text'] ) );
                                    echo esc_html( $omega_blogger_footer_copyright_text );

                                    echo '<br>';
                                    echo esc_html__('Theme: ', 'omega-blogger') . '<a href="' . esc_url('https://www.omegathemes.com/products/free-blog-wordpress-theme') . '" title="' . esc_attr__('Omega Blogger', 'omega-blogger') . '" target="_blank"><span>' . esc_html__('Omega Blogger', 'omega-blogger') . '</span></a>' . esc_html__(' By ', 'omega-blogger') . '  <span>' . esc_html__('OMEGA ', 'omega-blogger') . '</span>';
                                    echo esc_html__('Powered by ', 'omega-blogger') . '<a href="' . esc_url('https://wordpress.org') . '" title="' . esc_attr__('WordPress', 'omega-blogger') . '" target="_blank"><span>' . esc_html__('WordPress.', 'omega-blogger') . '</span></a>';
                                 ?>
                            </div>
                        </div>
                    </div>
                    <div class="column column-3 align-text-right">
                        <a class="to-the-top" href="#site-header">
                            <span class="to-the-top-long">
                                <?php if ( get_theme_mod('omega_blogger_enable_to_the_top', true) == true ) : ?>
                                    <?php
                                    $omega_blogger_to_the_top_text = get_theme_mod( 'omega_blogger_to_the_top_text', __( 'To the Top', 'omega-blogger' ) );
                                    printf( 
                                        wp_kses( 
                                            /* translators: %s is the arrow icon markup */
                                            '%s %s', 
                                            array( 'span' => array( 'class' => array(), 'aria-hidden' => array() ) ) 
                                        ), 
                                        esc_html( $omega_blogger_to_the_top_text ),
                                        '<span class="arrow" aria-hidden="true">&uarr;</span>' 
                                    );
                                    ?>
                                <?php endif; ?>
                            </span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    <?php
    }

endif;

add_action( 'omega_blogger_footer_content_action','omega_blogger_footer_content_info',20 );


if( !function_exists( 'omega_blogger_main_slider' ) ) :

    function omega_blogger_main_slider(){

        $omega_blogger_header_banner = omega_blogger_get_default_theme_options();
        $omega_blogger_header_banner = get_theme_mod( 'omega_blogger_header_banner', $omega_blogger_header_banner['omega_blogger_header_banner'] );
        $omega_blogger_header_banner_cat = get_theme_mod( 'omega_blogger_header_banner_cat','uncategorized' );
        $omega_blogger_banner_right_cat = get_theme_mod( 'omega_blogger_banner_right_cat','Food' );

        if( $omega_blogger_header_banner ){
            if( $omega_blogger_header_banner_cat || $omega_blogger_banner_right_cat ){ ?>
                <div class="slider-box" style="background-image: url(<?php echo esc_url(get_template_directory_uri()) ?>/assets/images/slider-bg.png)">
                    <div class="wrapper">
                        <div class="slider-main">
                            <div class="right-box">
                                <?php if( $omega_blogger_header_banner_cat ){ ?>
                                    <?php
                                    $rtl = '';
                                    if( is_rtl() ){
                                        $rtl = 'dir="rtl"';
                                    }
                                    $omega_blogger_banner_query = new WP_Query( array('post_type' => 'post', 'posts_per_page' => 4,'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $omega_blogger_header_banner_cat ) ) );
                                    if( $omega_blogger_banner_query->have_posts() ): ?>
                                        <div class="theme-custom-block theme-banner-block">
                                            <div class="swiper-container theme-main-carousel swiper-container" <?php echo $rtl; ?>>
                                                <div class="swiper-wrapper">
                                                    <?php
                                                    while( $omega_blogger_banner_query->have_posts() ):
                                                    $omega_blogger_banner_query->the_post();
                                                    $omega_blogger_featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                                                    $omega_blogger_default_image = get_template_directory_uri() . '/inc/homepage-setup/assets/homepage-setup-images/slider-img1.png'; // Replace with the actual path to your default image  
                                                    $omega_blogger_featured_image = isset( $omega_blogger_featured_image[0] ) ? $omega_blogger_featured_image[0] : $omega_blogger_default_image;?>
                                                        <div class="swiper-slide main-carousel-item">                                 
                                                            <div class="theme-article-post">
                                                                <div class="main-carousel-caption">
                                                                    <div class="post-content">
                                                                        <header class="entry-header">
                                                                            <div id="authorphoto">
                                                                                <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="author"> <?php echo get_avatar( get_the_author_meta('ID')); ?></a>
                                                                                <div class="entry-author">
                                                                                    <span><a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php the_author(); ?></a></span>
                                                                                    <span class="slide-cat"><?php the_category(); ?></span>
                                                                                </div>
                                                                                
                                                                            </div>
                                                                            <h2 class="entry-title">
                                                                                <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
                                                                            </h2>
                                                                            <div class="entry-content">
                                                                                <?php
                                                                                if (has_excerpt()) {

                                                                                    the_excerpt();

                                                                                } else {

                                                                                    echo esc_html(wp_trim_words(get_the_content(), 25, '...'));

                                                                                } ?>
                                                                            </div>
                                                                            <div class="meta-box">
                                                                                <span> 
                                                                                    <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V192H0v272zm320-196c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM192 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM64 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zM400 64h-48V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H160V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H48C21.5 64 0 85.5 0 112v48h448v-48c0-26.5-21.5-48-48-48z"/></svg>
                                                                                    <?php echo esc_html( get_the_date('d/m/y')) ; ?>
                                                                                </span>
                                                                                <span>
                                                                                    <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M256 8C119 8 8 119 8 256S119 504 256 504 504 393 504 256 393 8 256 8zm92.5 313h0l-20 25a16 16 0 0 1 -22.5 2.5h0l-67-49.7a40 40 0 0 1 -15-31.2V112a16 16 0 0 1 16-16h32a16 16 0 0 1 16 16V256l58 42.5A16 16 0 0 1 348.5 321z"/></svg>
                                                                                    <?php echo esc_html( get_the_time()) ; ?>
                                                                                </span>
                                                                                <span id='menu'>
                                                                                  <span class='Social'>
                                                                                    <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M352 320c-22.6 0-43.4 7.8-59.8 20.9l-102.5-64.1a96.6 96.6 0 0 0 0-41.7l102.5-64.1C308.6 184.2 329.4 192 352 192c53 0 96-43 96-96S405 0 352 0s-96 43-96 96c0 7.2 .8 14.1 2.3 20.8L155.8 180.9C139.4 167.8 118.6 160 96 160c-53 0-96 43-96 96s43 96 96 96c22.6 0 43.4-7.8 59.8-20.9l102.5 64.1A96.3 96.3 0 0 0 256 416c0 53 43 96 96 96s96-43 96-96-43-96-96-96z"/></svg><?php echo esc_html('Share','blog-pro'); ?>
                                                                                  </span>
                                                                                  <div class='media' id="media">
                                                                                    <span>
                                                                                        <a href="https://www.linkedin.com/sharer.php?u=<?php echo the_permalink(); ?>&title=<?php echo the_title(); ?>&source=<?php echo the_title(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em"viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M100.3 448H7.4V148.9h92.9zM53.8 108.1C24.1 108.1 0 83.5 0 53.8a53.8 53.8 0 0 1 107.6 0c0 29.7-24.1 54.3-53.8 54.3zM447.9 448h-92.7V302.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V448h-92.8V148.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V448z"/></svg></a>
                                                                                     
                                                                                    </span>
                                                                                    <span>
                                                                                        <a href="https://twitter.com/share?url=<?php echo the_permalink(); ?>&amp;text=<?php echo the_title(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg></a>
                                                                                      
                                                                                    </span>
                                                                                    <span>
                                                                                        <a href="https://www.facebook.com/sharer.php?u=<?php echo the_permalink(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --><path d="M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"/></svg></a>

                                                                                    </span>
                                                                                  </div>
                                                                                </span>
                                                                            </div>
                                                                        </header>
                                                                        <a href="<?php the_permalink(); ?>" class="btn-fancy btn-fancy-primary" tabindex="0">
                                                                            <?php echo esc_html__('Read More', 'omega-blogger'); ?><span><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 320 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M285.5 273L91.1 467.3c-9.4 9.4-24.6 9.4-33.9 0l-22.7-22.7c-9.4-9.4-9.4-24.5 0-33.9L188.5 256 34.5 101.3c-9.3-9.4-9.3-24.5 0-33.9l22.7-22.7c9.4-9.4 24.6-9.4 33.9 0L285.5 239c9.4 9.4 9.4 24.6 0 33.9z"/></svg></span>
                                                                        </a>
                                                                    </div>
                                                                </div>
                                                                <div class="entry-thumbnail">
                                                                    <div class="data-bg data-bg-large featured-image" data-background="<?php echo esc_url($omega_blogger_featured_image); ?>">
                                                                        <a href="<?php the_permalink(); ?>" class="theme-image-responsive" tabindex="0"></a>
                                                                    </div>
                                                                    <?php omega_blogger_post_format_icon(); ?>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    <?php endwhile; ?>
                                                </div>
                                                <div class="swiper-pagination"></div>
                                            </div>
                                        </div>
                                    <?php
                                        wp_reset_postdata();
                                        endif; ?>
                                <?php }?>
                            </div>
                            <div class="main-banner">
                                <?php if( $omega_blogger_banner_right_cat ){ ?>
                                    <div class="banner-div">
                                        <div class="main-banner-box">
                                            <?php
                                            $omega_blogger_banner_query = new WP_Query( array('post_type' => 'post', 'posts_per_page' => -1,'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $omega_blogger_banner_right_cat ) ) );
                                            if( $omega_blogger_banner_query->have_posts() ): ?>
                                                <?php
                                                while( $omega_blogger_banner_query->have_posts() ):
                                                $omega_blogger_banner_query->the_post();
                                                $omega_blogger_featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                                                $omega_blogger_default_image = get_template_directory_uri() . '/inc/homepage-setup/assets/homepage-setup-images/post-img1.png'; // Replace with the actual path to your default image  
                                                $omega_blogger_featured_image = isset( $omega_blogger_featured_image[0] ) ? $omega_blogger_featured_image[0] : $omega_blogger_default_image;?>                           
                                                <div class="theme-article-post">
                                                    <div class="entry-thumbnail">
                                                        <div class="data-bg data-bg-large featured-image" data-background="<?php echo esc_url($omega_blogger_featured_image); ?>">
                                                            <a href="<?php the_permalink(); ?>" class="theme-image-responsive" tabindex="0"></a>
                                                        </div>
                                                        <?php omega_blogger_post_format_icon(); ?>
                                                    </div>
                                                    <div class="main-carousel-caption">
                                                        <div class="post-content">
                                                            <header class="entry-header">
                                                                <span class="slider-cat"><?php the_category(); ?></span>
                                                                <h2 class="entry-title">
                                                                    <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
                                                                </h2>
                                                            </header>
                                                            <div class="meta-box">
                                                                <span>
                                                                    <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"/></svg>
                                                                    <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php the_author(); ?></a>
                                                                </span>
                                                                <span> 
                                                                    <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V192H0v272zm320-196c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM192 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12h-40c-6.6 0-12-5.4-12-12v-40zM64 268c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zm0 128c0-6.6 5.4-12 12-12h40c6.6 0 12 5.4 12 12v40c0 6.6-5.4 12-12 12H76c-6.6 0-12-5.4-12-12v-40zM400 64h-48V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H160V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48H48C21.5 64 0 85.5 0 112v48h448v-48c0-26.5-21.5-48-48-48z"/></svg>
                                                                    <?php echo esc_html( get_the_date('d/m/y')) ; ?>
                                                                </span>
                                                                <span id='menu'>
                                                                    <span class='Social'>
                                                                        <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M352 320c-22.6 0-43.4 7.8-59.8 20.9l-102.5-64.1a96.6 96.6 0 0 0 0-41.7l102.5-64.1C308.6 184.2 329.4 192 352 192c53 0 96-43 96-96S405 0 352 0s-96 43-96 96c0 7.2 .8 14.1 2.3 20.8L155.8 180.9C139.4 167.8 118.6 160 96 160c-53 0-96 43-96 96s43 96 96 96c22.6 0 43.4-7.8 59.8-20.9l102.5 64.1A96.3 96.3 0 0 0 256 416c0 53 43 96 96 96s96-43 96-96-43-96-96-96z"/></svg><?php echo esc_html('Share','blog-pro'); ?>
                                                                    </span>
                                                                    <div class='media' id="media">
                                                                        <span>
                                                                            <a href="https://www.linkedin.com/sharer.php?u=<?php echo the_permalink(); ?>&title=<?php echo the_title(); ?>&source=<?php echo the_title(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em"viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M100.3 448H7.4V148.9h92.9zM53.8 108.1C24.1 108.1 0 83.5 0 53.8a53.8 53.8 0 0 1 107.6 0c0 29.7-24.1 54.3-53.8 54.3zM447.9 448h-92.7V302.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V448h-92.8V148.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V448z"/></svg></a>
                                                                         
                                                                        </span>
                                                                        <span>
                                                                            <a href="https://twitter.com/share?url=<?php echo the_permalink(); ?>&amp;text=<?php echo the_title(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg></a>
                                                                          
                                                                        </span>
                                                                        <span>
                                                                            <a href="https://www.facebook.com/sharer.php?u=<?php echo the_permalink(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --><path d="M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"/></svg></a>
                                                                          
                                                                        </span>
                                                                    </div>
                                                                </span>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            <?php endwhile; ?>
                                                <?php
                                                wp_reset_postdata();
                                                endif;
                                            } ?>
                                        </div>
                                    </div>
                                <?php }?>
                            </div>
                        </div>
                    </div>
                </div>
     <?php }
 }

endif;

if( !function_exists( 'omega_blogger_pricing_plans_section' ) ) :

    function omega_blogger_pricing_plans_section(){ 

        $omega_blogger_pricing_plans_section = omega_blogger_get_default_theme_options();

        $omega_blogger_most_read_section_title = esc_html( get_theme_mod( 'omega_blogger_most_read_section_title',
        $omega_blogger_pricing_plans_section['omega_blogger_most_read_section_title'] ) );

        $omega_blogger_most_read_section_sub_title = esc_html( get_theme_mod( 'omega_blogger_most_read_section_sub_title',
        $omega_blogger_pricing_plans_section['omega_blogger_most_read_section_sub_title'] ) );

        $omega_blogger_most_read_section_cat = get_theme_mod( 'omega_blogger_most_read_section_cat','uncategorized' );

        $omega_blogger_most_read_right_section_cat = get_theme_mod( 'omega_blogger_most_read_right_section_cat','Travel' );

        ?>
        <div class="most-read">
            <div class="wrapper">
                <div class="most-read-div">
                    <div class="blog-main-box">
                        <div class="list-heading-main">
                            <h3 class="list-title">
                                <?php if( $omega_blogger_most_read_section_title ){ ?>
                                    <?php echo esc_html($omega_blogger_most_read_section_title) ?>
                                <?php } ?>
                            </h3>
                            <p class="list-sub-title">
                                <?php if( $omega_blogger_most_read_section_sub_title ){ ?>
                                    <?php echo esc_html($omega_blogger_most_read_section_sub_title) ?>
                                <?php } ?>
                            </p>
                        </div>
                        <div class="main-blog-box">
                            <div class="blog-box">
                                <?php if( $omega_blogger_most_read_section_cat ){ ?>
                                    <?php
                                    $omega_blogger_banner_query = new WP_Query( array('post_type' => 'post', 'posts_per_page' => -1,'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $omega_blogger_most_read_section_cat ) ) );
                                    if( $omega_blogger_banner_query->have_posts() ): ?>
                                        <?php
                                        while( $omega_blogger_banner_query->have_posts() ):
                                        $omega_blogger_banner_query->the_post();
                                        $omega_blogger_featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                                        $omega_blogger_default_image = get_template_directory_uri() . '/inc/homepage-setup/assets/homepage-setup-images/section1.png'; // Replace with the actual path to your default image  
                                        $omega_blogger_featured_image = isset( $omega_blogger_featured_image[0] ) ? $omega_blogger_featured_image[0] : $omega_blogger_default_image;?>                           
                                        <div class="theme-article-post">
                                            <div class="entry-thumbnail">
                                                <div class="data-bg data-bg-large featured-image" data-background="<?php echo esc_url($omega_blogger_featured_image); ?>">
                                                    <a href="<?php the_permalink(); ?>" class="theme-image-responsive" tabindex="0"></a>
                                                </div>
                                                <?php omega_blogger_post_format_icon(); ?>
                                            </div>
                                            <div class="post-content">
                                                <div class="meta-box">
                                                    <span>
                                                        <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"/></svg>
                                                        <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php the_author(); ?></a>
                                                    </span>
                                                    <span class="middle-cat">
                                                        <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 252.1V48C0 21.5 21.5 0 48 0h204.1a48 48 0 0 1 33.9 14.1l211.9 211.9c18.7 18.7 18.7 49.1 0 67.9L293.8 497.9c-18.7 18.7-49.1 18.7-67.9 0L14.1 286.1A48 48 0 0 1 0 252.1zM112 64c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"/></svg>
                                                        <?php the_category(); ?>
                                                    </span>
                                                    <span id='menu'>
                                                        <span class='Social'>
                                                            <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M352 320c-22.6 0-43.4 7.8-59.8 20.9l-102.5-64.1a96.6 96.6 0 0 0 0-41.7l102.5-64.1C308.6 184.2 329.4 192 352 192c53 0 96-43 96-96S405 0 352 0s-96 43-96 96c0 7.2 .8 14.1 2.3 20.8L155.8 180.9C139.4 167.8 118.6 160 96 160c-53 0-96 43-96 96s43 96 96 96c22.6 0 43.4-7.8 59.8-20.9l102.5 64.1A96.3 96.3 0 0 0 256 416c0 53 43 96 96 96s96-43 96-96-43-96-96-96z"/></svg><?php echo esc_html('Share','blog-pro'); ?>
                                                        </span>
                                                        <div class='media' id="media">
                                                            <span>
                                                                <a href="https://www.linkedin.com/sharer.php?u=<?php echo the_permalink(); ?>&title=<?php echo the_title(); ?>&source=<?php echo the_title(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em"viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M100.3 448H7.4V148.9h92.9zM53.8 108.1C24.1 108.1 0 83.5 0 53.8a53.8 53.8 0 0 1 107.6 0c0 29.7-24.1 54.3-53.8 54.3zM447.9 448h-92.7V302.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V448h-92.8V148.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V448z"/></svg></a>
                                                             
                                                            </span>
                                                            <span>
                                                                <a href="https://twitter.com/share?url=<?php echo the_permalink(); ?>&amp;text=<?php echo the_title(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg></a>
                                                              
                                                            </span>
                                                            <span>
                                                                <a href="https://www.facebook.com/sharer.php?u=<?php echo the_permalink(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --><path d="M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"/></svg></a>
                                                              
                                                            </span>
                                                        </div>
                                                    </span>
                                                </div>
                                                <header class="entry-header">
                                                    <h2 class="entry-title">
                                                        <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
                                                    </h2>
                                                </header>
                                            </div>
                                        </div>
                                    <?php endwhile; ?>
                                    <?php
                                        wp_reset_postdata();
                                        endif;
                                    ?>
                                <?php } ?>
                            </div>
                            <div class="middle-blog-box">
                                <?php if( $omega_blogger_most_read_right_section_cat ){ ?>
                                    <?php
                                    $omega_blogger_banner_query = new WP_Query( array('post_type' => 'post', 'posts_per_page' => -1,'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $omega_blogger_most_read_right_section_cat ) ) );
                                    if( $omega_blogger_banner_query->have_posts() ): ?>
                                        <?php
                                        while( $omega_blogger_banner_query->have_posts() ):
                                        $omega_blogger_banner_query->the_post();
                                        $omega_blogger_featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large');
                                        $omega_blogger_default_image = get_template_directory_uri() . '/assets/images/section2.png'; // Replace with the actual path to your default image  
                                        $omega_blogger_featured_image = isset( $omega_blogger_featured_image[0] ) ? $omega_blogger_featured_image[0] : $omega_blogger_default_image;?>                           
                                        <div class="theme-article-post">
                                            <div class="entry-thumbnail">
                                                <div class="data-bg data-bg-large featured-image" data-background="<?php echo esc_url($omega_blogger_featured_image); ?>">
                                                    <a href="<?php the_permalink(); ?>" class="theme-image-responsive" tabindex="0"></a>
                                                </div>
                                                <?php omega_blogger_post_format_icon(); ?>
                                            </div>
                                            <div class="post-content">
                                                <div class="meta-box">
                                                    <span>
                                                        <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"/></svg>
                                                        <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>"><?php the_author(); ?></a>
                                                    </span>
                                                    <span class="middle-cat">
                                                        <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M0 252.1V48C0 21.5 21.5 0 48 0h204.1a48 48 0 0 1 33.9 14.1l211.9 211.9c18.7 18.7 18.7 49.1 0 67.9L293.8 497.9c-18.7 18.7-49.1 18.7-67.9 0L14.1 286.1A48 48 0 0 1 0 252.1zM112 64c-26.5 0-48 21.5-48 48s21.5 48 48 48 48-21.5 48-48-21.5-48-48-48z"/></svg>
                                                        <?php the_category(); ?>
                                                    </span>
                                                    <span id='menu'>
                                                        <span class='Social'>
                                                            <svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M352 320c-22.6 0-43.4 7.8-59.8 20.9l-102.5-64.1a96.6 96.6 0 0 0 0-41.7l102.5-64.1C308.6 184.2 329.4 192 352 192c53 0 96-43 96-96S405 0 352 0s-96 43-96 96c0 7.2 .8 14.1 2.3 20.8L155.8 180.9C139.4 167.8 118.6 160 96 160c-53 0-96 43-96 96s43 96 96 96c22.6 0 43.4-7.8 59.8-20.9l102.5 64.1A96.3 96.3 0 0 0 256 416c0 53 43 96 96 96s96-43 96-96-43-96-96-96z"/></svg><?php echo esc_html('Share','blog-pro'); ?>
                                                        </span>
                                                        <div class='media' id="media">
                                                            <span>
                                                                <a href="https://www.linkedin.com/sharer.php?u=<?php echo the_permalink(); ?>&title=<?php echo the_title(); ?>&source=<?php echo the_title(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em"viewBox="0 0 448 512"><!--!Font Awesome Free 6.5.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2024 Fonticons, Inc.--><path d="M100.3 448H7.4V148.9h92.9zM53.8 108.1C24.1 108.1 0 83.5 0 53.8a53.8 53.8 0 0 1 107.6 0c0 29.7-24.1 54.3-53.8 54.3zM447.9 448h-92.7V302.4c0-34.7-.7-79.2-48.3-79.2-48.3 0-55.7 37.7-55.7 76.7V448h-92.8V148.9h89.1v40.8h1.3c12.4-23.5 42.7-48.3 87.9-48.3 94 0 111.3 61.9 111.3 142.3V448z"/></svg></a>
                                                             
                                                            </span>
                                                            <span>
                                                                <a href="https://twitter.com/share?url=<?php echo the_permalink(); ?>&amp;text=<?php echo the_title(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --><path d="M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"/></svg></a>
                                                              
                                                            </span>
                                                            <span>
                                                                <a href="https://www.facebook.com/sharer.php?u=<?php echo the_permalink(); ?>" target="_blank"><svg xmlns="http://www.w3.org/2000/svg" height="1em" viewBox="0 0 512 512"><!--! Font Awesome Free 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2024 Fonticons, Inc. --><path d="M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z"/></svg></a>
                                                              
                                                            </span>
                                                        </div>
                                                    </span>
                                                </div>
                                                <header class="entry-header">
                                                    <h2 class="entry-title">
                                                        <a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a>
                                                    </h2>
                                                </header>
                                            </div>
                                        </div>
                                    <?php endwhile; ?>
                                    <?php
                                        wp_reset_postdata();
                                        endif;
                                    ?>
                                <?php } ?>
                            </div>
                        </div>
                    </div>
                    <div class="most-sidebar-box">
                        <aside id="secondary" class="widget-area">
                            <div class="widget-area-wrapper">
                                <?php dynamic_sidebar( 'sidebar-2' ); ?>
                            </div>
                        </aside>
                    </div>
                </div>
            </div>
        </div>
    <?php }

endif;

if (!function_exists('omega_blogger_post_format_icon')):

    // Post Format Icon.
    function omega_blogger_post_format_icon() {

        $omega_blogger_format = get_post_format(get_the_ID()) ?: 'standard';
        $omega_blogger_icon = '';
        $omega_blogger_title = '';
        if( $omega_blogger_format == 'video' ){
            $omega_blogger_icon = omega_blogger_get_theme_svg( 'video' );
            $omega_blogger_title = esc_html__('Video','omega-blogger');
        }elseif( $omega_blogger_format == 'audio' ){
            $omega_blogger_icon = omega_blogger_get_theme_svg( 'audio' );
            $omega_blogger_title = esc_html__('Audio','omega-blogger');
        }elseif( $omega_blogger_format == 'gallery' ){
            $omega_blogger_icon = omega_blogger_get_theme_svg( 'gallery' );
            $omega_blogger_title = esc_html__('Gallery','omega-blogger');
        }elseif( $omega_blogger_format == 'quote' ){
            $omega_blogger_icon = omega_blogger_get_theme_svg( 'quote' );
            $omega_blogger_title = esc_html__('Quote','omega-blogger');
        }elseif( $omega_blogger_format == 'image' ){
            $omega_blogger_icon = omega_blogger_get_theme_svg( 'image' );
            $omega_blogger_title = esc_html__('Image','omega-blogger');
        } elseif( $omega_blogger_format == 'link' ){
            $omega_blogger_icon = omega_blogger_get_theme_svg( 'link' );
            $omega_blogger_title = esc_html__('Link','omega-blogger');
        } elseif( $omega_blogger_format == 'status' ){
            $omega_blogger_icon = omega_blogger_get_theme_svg( 'status' );
            $omega_blogger_title = esc_html__('Status','omega-blogger');
        } elseif( $omega_blogger_format == 'aside' ){
            $omega_blogger_icon = omega_blogger_get_theme_svg( 'aside' );
            $omega_blogger_title = esc_html__('Aside','omega-blogger');
        } elseif( $omega_blogger_format == 'chat' ){
            $omega_blogger_icon = omega_blogger_get_theme_svg( 'chat' );
            $omega_blogger_title = esc_html__('Chat','omega-blogger');
        }
        
        if (!empty($omega_blogger_icon)) { ?>
            <div class="theme-post-format">
                <span class="post-format-icom"><?php echo omega_blogger_svg_escape($omega_blogger_icon); ?></span>
                <?php if( $omega_blogger_title ){ echo '<span class="post-format-label">'.esc_html( $omega_blogger_title ).'</span>'; } ?>
            </div>
        <?php }
    }

endif;

if ( ! function_exists( 'omega_blogger_svg_escape' ) ):

    /**
     * Get information about the SVG icon.
     *
     * @param string $omega_blogger_svg_name The name of the icon.
     * @param string $group The group the icon belongs to.
     * @param string $color Color code.
     */
    function omega_blogger_svg_escape( $omega_blogger_input ) {

        // Make sure that only our allowed tags and attributes are included.
        $omega_blogger_svg = wp_kses(
            $omega_blogger_input,
            array(
                'svg'     => array(
                    'class'       => true,
                    'xmlns'       => true,
                    'width'       => true,
                    'height'      => true,
                    'viewbox'     => true,
                    'aria-hidden' => true,
                    'role'        => true,
                    'focusable'   => true,
                ),
                'path'    => array(
                    'fill'      => true,
                    'fill-rule' => true,
                    'd'         => true,
                    'transform' => true,
                ),
                'polygon' => array(
                    'fill'      => true,
                    'fill-rule' => true,
                    'points'    => true,
                    'transform' => true,
                    'focusable' => true,
                ),
            )
        );

        if ( ! $omega_blogger_svg ) {
            return false;
        }

        return $omega_blogger_svg;

    }

endif;

if( !function_exists( 'omega_blogger_sanitize_sidebar_option_meta' ) ) :

    // Sidebar Option Sanitize.
    function omega_blogger_sanitize_sidebar_option_meta( $omega_blogger_input ){

        $omega_blogger_metabox_options = array( 'global-sidebar','left-sidebar','right-sidebar','no-sidebar' );
        if( in_array( $omega_blogger_input,$omega_blogger_metabox_options ) ){

            return $omega_blogger_input;

        }else{

            return '';

        }
    }

endif;


if( !function_exists( 'omega_blogger_sanitize_pagination_meta' ) ) :

    // Sidebar Option Sanitize.
    function omega_blogger_sanitize_pagination_meta( $omega_blogger_input ){

        $omega_blogger_metabox_options = array( 'Center','Right','Left');
        if( in_array( $omega_blogger_input,$omega_blogger_metabox_options ) ){

            return $omega_blogger_input;

        }else{

            return '';

        }
    }

endif;

if( !function_exists( 'omega_blogger_sanitize_menu_transform' ) ) :

    // Sidebar Option Sanitize.
    function omega_blogger_sanitize_menu_transform( $omega_blogger_input ){

        $omega_blogger_metabox_options = array( 'capitalize','uppercase','lowercase');
        if( in_array( $omega_blogger_input,$omega_blogger_metabox_options ) ){

            return $omega_blogger_input;

        }else{

            return '';

        }
    }

endif;

if( !function_exists( 'omega_blogger_sanitize_page_content_alignment' ) ) :

    // Sidebar Option Sanitize.
    function omega_blogger_sanitize_page_content_alignment( $omega_blogger_input ){

        $omega_blogger_metabox_options = array( 'left','center','right');
        if( in_array( $omega_blogger_input,$omega_blogger_metabox_options ) ){

            return $omega_blogger_input;

        }else{

            return '';

        }
    }

endif;

if( !function_exists( 'omega_blogger_sanitize_footer_widget_title_alignment' ) ) :

    // Footer Option Sanitize.
    function omega_blogger_sanitize_footer_widget_title_alignment( $omega_blogger_input ){

        $omega_blogger_metabox_options = array( 'left','center','right');
        if( in_array( $omega_blogger_input,$omega_blogger_metabox_options ) ){

            return $omega_blogger_input;

        }else{

            return '';

        }
    }

endif;

if( !function_exists( 'omega_blogger_sanitize_pagination_meta' ) ) :

    // Sidebar Option Sanitize.
    function omega_blogger_sanitize_pagination_meta( $omega_blogger_input ){

        $omega_blogger_metabox_options = array( 'Center','Right','Left');
        if( in_array( $omega_blogger_input,$omega_blogger_metabox_options ) ){

            return $omega_blogger_input;

        }else{

            return '';

        }
    }

endif;

if( !function_exists( 'omega_blogger_sanitize_pagination_type' ) ) :

    /**
     * Sanitize the pagination type setting.
     *
     * @param string $omega_blogger_input The input value from the Customizer.
     * @return string The sanitized value.
     */
    function omega_blogger_sanitize_pagination_type( $omega_blogger_input ) {
        // Define valid options for the pagination type.
        $omega_blogger_valid_options = array( 'numeric', 'newer_older' ); // Update valid options to include 'newer_older'

        // If the input is one of the valid options, return it. Otherwise, return the default option ('numeric').
        if ( in_array( $omega_blogger_input, $omega_blogger_valid_options, true ) ) {
            return $omega_blogger_input;
        } else {
            // Return 'numeric' as the fallback if the input is invalid.
            return 'numeric';
        }
    }

endif;


// Sanitize the enable/disable setting for pagination
if( !function_exists('omega_blogger_sanitize_enable_pagination') ) :
    function omega_blogger_sanitize_enable_pagination( $omega_blogger_input ) {
        return (bool) $omega_blogger_input;
    }
endif;

if( !function_exists( 'omega_blogger_sanitize_copyright_alignment_meta' ) ) :

    // Sidebar Option Sanitize.
    function omega_blogger_sanitize_copyright_alignment_meta( $omega_blogger_input ){

        $omega_blogger_metabox_options = array( 'Default','Reverse','Center');
        if( in_array( $omega_blogger_input,$omega_blogger_metabox_options ) ){

            return $omega_blogger_input;

        }else{

            return '';

        }
    }

endif;

/**
 * Sidebar Layout Function
 */
function omega_blogger_get_final_sidebar_layout() {
	$omega_blogger_defaults       = omega_blogger_get_default_theme_options();
	$omega_blogger_global_layout  = get_theme_mod('omega_blogger_global_sidebar_layout', $omega_blogger_defaults['omega_blogger_global_sidebar_layout']);
	$omega_blogger_page_layout    = get_theme_mod('omega_blogger_page_sidebar_layout', $omega_blogger_global_layout);
	$omega_blogger_post_layout    = get_theme_mod('omega_blogger_post_sidebar_layout', $omega_blogger_global_layout);
	$omega_blogger_meta_layout    = get_post_meta(get_the_ID(), 'omega_blogger_post_sidebar_option', true);

	if (!empty($omega_blogger_meta_layout) && $omega_blogger_meta_layout !== 'default') {
		return $omega_blogger_meta_layout;
	}
	if (is_page() || (function_exists('is_shop') && is_shop())) {
		return $omega_blogger_page_layout;
	}
	if (is_single()) {
		return $omega_blogger_post_layout;
	}
	return $omega_blogger_global_layout;
}