HEX
Server: Apache
System: Linux SH-FR-PM-y8qo 6.6.80-paas #1 SMP PREEMPT_DYNAMIC Thu Sep 25 11:18:23 UTC 2025 x86_64
User: hosting-user (5000)
PHP: 8.3.28
Disabled: NONE
Upload Files
File: /srv/data/web/vhosts/resiliencejoyeuse.net/htdocs/wp-content/themes/ashe-pro-premium/functions.php
<?php

/*
** Sets up theme defaults and registers support for various WordPress features
*/
function ashe_setup() {
    // Make theme available for translation
    load_theme_textdomain( 'ashe-pro' );
    // Add default posts and comments RSS feed links to head
    add_theme_support( 'automatic-feed-links' );
    // Let WordPress manage the document title for us
    add_theme_support( 'title-tag' );
    // Enable support for Post Thumbnails on posts and pages
    add_theme_support( 'post-thumbnails' );
    // Add theme support for Custom Logo.
    $custom_logo_defaults = array(
        'width'       => 450,
        'height'      => 200,
        'flex-width'  => true,
        'flex-height' => true,
    );
    add_theme_support( 'custom-logo', $custom_logo_defaults );
    // Add theme support for Custom Header.
    $custom_header_defaults = array(
        'width'              => 1300,
        'height'             => 500,
        'flex-width'         => true,
        'flex-height'        => true,
        'default-image'      => get_template_directory_uri() . '/assets/images/hdrimg.jpg',
        'default-text-color' => '111',
    );
    add_theme_support( 'custom-header', $custom_header_defaults );
    // Add theme support for Custom Background.
    $custom_background_defaults = array(
        'default-color' => '',
    );
    add_theme_support( 'custom-background', $custom_background_defaults );
    // Set the default content width.
    $GLOBALS['content_width'] = 960;
    // This theme uses wp_nav_menu() in two locations
    register_nav_menus( array(
        'top'    => __( 'Top Menu', 'ashe-pro' ),
        'main'   => __( 'Main Menu', 'ashe-pro' ),
        'footer' => __( 'Footer Menu', 'ashe-pro' ),
    ) );
    // Switch default core markup to output valid HTML5
    add_theme_support( 'html5', array(
        'comment-form',
        'comment-list',
        'gallery',
        'caption'
    ) );
    // Gutenberg Embeds
    add_theme_support( 'responsive-embeds' );
    // Add support for full and wide align images.
    add_theme_support( 'align-wide' );
    // Formats support
    add_theme_support( 'post-formats', array(
        'audio',
        'video',
        'gallery',
        'link',
        'quote'
    ) );
    // Custom Image Sizes
    add_image_size(
        'ashe-slider-grid-thumbnail',
        ashe_options( 'featured_slider_crop_width' ),
        ashe_options( 'featured_slider_crop_height' ),
        true
    );
    add_image_size(
        'ashe-full-thumbnail',
        1140,
        0,
        true
    );
    add_image_size(
        'ashe-grid-thumbnail',
        ashe_options( 'blog_page_grid_crop_width' ),
        ashe_options( 'blog_page_grid_crop_height' ),
        true
    );
    add_image_size(
        'ashe-list-thumbnail',
        ashe_options( 'blog_page_list_crop_width' ),
        ashe_options( 'blog_page_list_crop_height' ),
        true
    );
    add_image_size(
        'ashe-single-navigation',
        75,
        75,
        true
    );
    // WooCommerce support
    add_theme_support( 'woocommerce' );
    add_theme_support( 'wc-product-gallery-zoom' );
    add_theme_support( 'wc-product-gallery-lightbox' );
    add_theme_support( 'wc-product-gallery-slider' );
    // Classic Widgets Notice
    add_action( 'admin_notices', 'ashe_classic_widgets_notice' );
}

add_action( 'after_setup_theme', 'ashe_setup' );
add_action( 'after_switch_theme', 'ashe_pro_activation_time' );
// add_action( 'after_switch_theme', 'delete_ashe_pro_dismiss_on_activation' );
add_action( 'after_setup_theme', 'ashe_pro_activation_time' );
function ashe_pro_activation_time() {
    // if ( false === get_option( 'ashe_pro_activation_time_get_another_license' ) ) {
    //     add_option( 'ashe_pro_activation_time_get_another_license', strtotime( 'now' ) );
    // }
    if ( false === get_option( 'ashe_pro_activation_time' ) ) {
        add_option( 'ashe_pro_activation_time', strtotime( 'now' ) );
    }
    if ( false === get_option( 'ashe_pro_random_number' ) ) {
        add_option( 'ashe_pro_random_number', rand( 10, 20 ) );
    }
    // if ( get_option( 'ashe_pro_previous_version' ) == false ) {
    //     update_option( 'ashe_pro_previous_version', wp_get_theme()->get( 'Version' ) );
    // }
    // if ( wp_get_theme()->get( 'Version' ) != get_option( 'ashe_pro_previous_version' ) ) {
    //     delete_option( 'ashe_pro_get_another_license_dismiss_notice' );
    //     update_option( 'ashe_pro_previous_version', wp_get_theme()->get( 'Version' ) );
    // }
}

// function delete_ashe_pro_dismiss_on_activation()
// {
//     delete_option( 'ashe_pro_get_another_license_dismiss_notice' );
// }
// require get_parent_theme_file_path( '/inc/another-license/another-license.php' );
/*
** Integrate Freemius
*/
function ashe_freemius() {
    global $ashe_freemius;
    if ( !isset( $ashe_freemius ) ) {
        // Include Freemius SDK.
        require_once dirname( __FILE__ ) . '/freemius/start.php';
        $ashe_freemius = fs_dynamic_init( array(
            'id'               => '1802',
            'slug'             => 'ashe-pro',
            'type'             => 'theme',
            'public_key'       => 'pk_4fc51483fc5c6bb76d3804ff790c4',
            'is_premium'       => true,
            'is_premium_only'  => true,
            'has_addons'       => false,
            'has_paid_plans'   => true,
            'is_org_compliant' => false,
            'has_affiliation'  => 'selected',
            'trial'            => array(
                'days'               => 7,
                'is_require_payment' => true,
            ),
            'menu'             => array(
                'slug'           => 'theme-license',
                'override_exact' => true,
                'contact'        => false,
                'support'        => false,
                'affiliation'    => true,
                'pricing'        => false,
                'parent'         => array(
                    'slug' => 'themes.php',
                ),
            ),
            'is_live'          => true,
        ) );
    }
    return $ashe_freemius;
}

// Init Freemius.
ashe_freemius();
// Signal that SDK was initiated.
do_action( 'ashe_freemius_loaded' );
function ashe_freemius_settings_url() {
    return admin_url( 'themes.php?page=theme-license&tab=ashe_license_tab' );
}

ashe_freemius()->add_filter( 'connect_url', 'ashe_freemius_settings_url' );
ashe_freemius()->add_filter( 'after_skip_url', 'ashe_freemius_settings_url' );
ashe_freemius()->add_filter( 'after_connect_url', 'ashe_freemius_settings_url' );
ashe_freemius()->add_filter( 'after_pending_connect_url', 'ashe_freemius_settings_url' );
ashe_freemius()->override_i18n( array(
    'cant-find-license-key' => 'Get my License Key',
) );
function ashe_freemius_custom_license_message(  $string, $first_name, $theme_name  ) {
    echo 'Thanks for purchasing <strong>' . $theme_name . '!</strong><br>';
    echo '<span>To receive further automatic theme updates, please enter your license key:</span>';
}

ashe_freemius()->add_filter(
    'connect-message_on-premium',
    'ashe_freemius_custom_license_message',
    10,
    4
);
function ashe_freemius_add_custom_html() {
    echo '<div class="wproyal-get-license-video"><a href="https://www.youtube.com/watch?v=dco0ngHAvHg" target="_blank">';
    echo '<strong>Watch the Video Guide</strong></a> - how to Get a License Key and Activate the theme.<br>';
    echo '<em>If you are having Trouble getting a License Key, please <a href="https://wp-royal-themes.com/contact/?ref=ashe-pro-backend-theme-license/" target="_blank">contact us.</a>';
    echo '</div>';
    wp_enqueue_style(
        'ashe-freemius',
        get_theme_file_uri( '/assets/css/freemius-license.css' ),
        array(),
        '3.5.4'
    );
}

ashe_freemius()->add_action( 'connect/after_license_input', 'ashe_freemius_add_custom_html' );
if ( !ashe_freemius()->can_use_premium_code() ) {
    if ( !is_admin() && !in_array( $GLOBALS['pagenow'], array('wp-login.php', 'wp-register.php') ) ) {
        echo '<div class="premium-notice">';
        echo '<span>Theme License is not active! Please <a href="' . get_admin_url( null, "themes.php?page=theme-license" ) . '">Activate it now</a> to get started or if you don\'t have one - <a href="' . get_admin_url( null, "themes.php?page=theme-license-pricing" ) . '">Buy it now.</a></span>';
        echo '</div>';
        echo '<style>.premium-notice{text-align:center;font-size:18px;color:#ffffff;padding:50px;overflow:hidden;background-color: #fb3a3a;}.premium-notice a{text-decoration:underline;color:#000}</style>';
    }
}
if ( ashe_freemius()->is_trial() ) {
    function add_toolbar_items(  $admin_bar  ) {
        $admin_bar->add_menu( array(
            'id'    => 'remove-trial',
            'title' => wp_kses_post( '<span style="color:greenyellow;font-weight:bold;">Remove Trial</span>' ),
            'href'  => get_admin_url( null, "themes.php?page=theme-license-pricing" ),
        ) );
        $admin_bar->add_menu( array(
            'id'    => 'theme-support',
            'title' => wp_kses_post( '<span style="color:yellow;font-weight:bold;">Get Help</span>' ),
            'href'  => 'https://wp-royal-themes.com/trial-support/?ref=ashe-pro-backend-trial-support',
            'meta'  => [
                'target' => '_blank',
            ],
        ) );
    }

    add_action( 'admin_bar_menu', 'add_toolbar_items', 9999 );
}
/*
** Notice for Classic Widgets Editor.
*/
function ashe_classic_widgets_notice() {
    $screen = get_current_screen();
    if ( !$screen || 'widgets' !== $screen->base || file_exists( ABSPATH . 'wp-content/plugins/classic-widgets/classic-widgets.php' ) ) {
        return;
    }
    ?>

    <div class="notice is-dismissible ashe-widgets-notice-wrap">
    	<div>
        	<p><?php 
    esc_html_e( 'Want to switch back to the Classic Widgets?', 'ashe-pro' );
    ?></p>

			<a class="button-primary" href="<?php 
    echo esc_url( wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=classic-widgets' ), 'install-plugin_classic-widgets' ) );
    ?>" >
				<?php 
    esc_html_e( 'Install Now', 'ashe-pro' );
    ?>
			</a>
        </div>
    </div>

	<style>.widgets-php .ashe-widgets-notice-wrap{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;max-width:360px;margin:0 auto;z-index:999;background:0 0;border:none;-webkit-box-shadow:none;box-shadow:none;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;margin-top:10px}.widgets-php .ashe-widgets-notice-wrap>div{display:-webkit-box;display:-ms-flexbox;display:flex}.widgets-php .ashe-widgets-notice-wrap .button-primary{height:20px;line-height:26px;font-size:12px;letter-spacing:.5px;margin-left:10px;margin-top:5px}.widgets-php .ashe-widgets-notice-wrap .notice-dismiss{display:none}.widgets-php .ashe-widgets-notice{text-align:center} </style>

    <?php 
}

/*
** Enqueue scripts and styles
*/
function ashe_scripts() {
    // Theme stylesheet
    wp_enqueue_style(
        'ashe-style',
        get_stylesheet_uri(),
        array(),
        '3.5.9'
    );
    // Theme Responsive CSS
    wp_enqueue_style(
        'ashe-responsive',
        get_theme_file_uri( '/assets/css/responsive.css' ),
        array(),
        '3.5.9'
    );
    // Fontello Icons
    wp_enqueue_style(
        'fontello',
        get_theme_file_uri( '/assets/css/fontello.css' ),
        array(),
        '3.5.4'
    );
    // Slick Slider
    wp_enqueue_style( 'slick', get_theme_file_uri( '/assets/css/slick.css' ) );
    // Scrollbar
    wp_enqueue_style( 'scrollbar', get_theme_file_uri( '/assets/css/perfect-scrollbar.css' ) );
    // WooCommerce
    if ( class_exists( 'WooCommerce' ) ) {
        wp_enqueue_style( 'ashe-woocommerce', get_theme_file_uri( '/assets/css/woocommerce.css' ) );
    }
    // Enqueue Custom Scripts
    wp_enqueue_script(
        'ashe-plugins',
        get_theme_file_uri( '/assets/js/custom-plugins.js' ),
        array('jquery'),
        '3.5.9.7',
        true
    );
    wp_enqueue_script(
        'ashe-custom-scripts',
        get_theme_file_uri( '/assets/js/custom-scripts.js' ),
        array('jquery'),
        '3.5.9.8',
        true
    );
    // Comment reply link
    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {
        wp_enqueue_script( 'comment-reply' );
    }
    // Wp Recipe Maker Support
    if ( class_exists( 'WPRM_Addons' ) && WPRM_Addons::is_active( 'pro' ) ) {
        wp_add_inline_style( 'ashe-style', '.wprm-recipe-container{padding:3px}.wprm-recipe-container .wprm-recipe{padding:20px;border:0}.wprm-recipe-image img{margin-bottom:10px!important}.wprm-recipe-print,.wprm-jump-to-recipe-shortcode,.wprm-print-recipe-shortcode{font-size:13px;line-height:1;padding:10px 15px!important}.wprm-recipe-print{display:inline-block;margin-bottom:15px}.wprm-recipe-buttons a{display:inline-block}.wprm-recipe-print span{display:none}.wprm-recipe-name,.wprm-recipe-header{margin-bottom:10px!important}.wprm-recipe-details-container,.wprm-recipe-notes-container p{padding:20px;clear:both}.wprm-recipe-details-container:first-child{margin-top:30px}.wprm-recipe-details-container > div{margin-bottom:20px}.wprm-recipe-details-container > div:last-child{margin-bottom:0}.wprm-recipe-details-icon svg{width:12px!important;height:12px!important;margin-top:-3px;margin-right:4px}.wprm-recipe-details-name{text-transform:uppercase}.wprm-recipe-ingredients-container,.wprm-recipe-instructions-container{margin-bottom:30px!important}.wprm-recipe-ingredients{padding-left:0!important}.wprm-recipe-ingredient{padding:5px 0}.wprm-recipe-instruction{margin-left:0!important;margin-bottom:15px!important;padding-bottom:10px;border-bottom:1px dashed}' );
    }
}

add_action( 'wp_enqueue_scripts', 'ashe_scripts' );
/*
** Register widget areas.
*/
function ashe_widgets_init() {
    register_sidebar( array(
        'name'          => __( 'Sidebar Right', 'ashe-pro' ),
        'id'            => 'sidebar-right',
        'description'   => __( 'Add widgets here to appear in your Right Sidebar.', 'ashe-pro' ),
        'before_widget' => '<div id="%1$s" class="ashe-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="widget-title"><h2>',
        'after_title'   => '</h2></div>',
    ) );
    register_sidebar( array(
        'name'          => __( 'Sidebar Left', 'ashe-pro' ),
        'id'            => 'sidebar-left',
        'description'   => __( 'Add widgets here to appear in your Left Sidebar.', 'ashe-pro' ),
        'before_widget' => '<div id="%1$s" class="ashe-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="widget-title"><h2>',
        'after_title'   => '</h2></div>',
    ) );
    register_sidebar( array(
        'name'          => __( 'Sidebar Alt', 'ashe-pro' ),
        'id'            => 'sidebar-alt',
        'description'   => __( 'Add widgets here to appear in your alternative/fixed sidebar.', 'ashe-pro' ),
        'before_widget' => '<div id="%1$s" class="ashe-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="widget-title"><h2>',
        'after_title'   => '</h2></div>',
    ) );
    register_sidebar( array(
        'name'          => __( 'Footer Widgets', 'ashe-pro' ),
        'id'            => 'footer-widgets',
        'description'   => __( 'Add widgets here to appear in your Footer Widgetised Area.', 'ashe-pro' ),
        'before_widget' => '<div id="%1$s" class="ashe-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="widget-title"><h2>',
        'after_title'   => '</h2></div>',
    ) );
    register_sidebar( array(
        'name'          => __( 'Instagram Widget', 'ashe-pro' ),
        'id'            => 'instagram-widget',
        'description'   => __( 'Add widget here to appear in your Footer Instagram Area.', 'ashe-pro' ),
        'before_widget' => '<div id="%1$s" class="ashe-instagram-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="instagram-title"><h2>',
        'after_title'   => '</h2></div>',
    ) );
    register_sidebar( array(
        'name'          => __( 'WooCommerce Sidebar Right', 'ashe-pro' ),
        'id'            => 'sidebar-shop-right',
        'description'   => __( 'Add widgets here to appear in your Shop Page Right Sidebar.', 'ashe-pro' ),
        'before_widget' => '<div id="%1$s" class="ashe-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="widget-title"><h2>',
        'after_title'   => '</h2></div>',
    ) );
    register_sidebar( array(
        'name'          => __( 'WooCommerce Sidebar Left', 'ashe-pro' ),
        'id'            => 'sidebar-shop-left',
        'description'   => __( 'Add widgets here to appear in your Shop Page Left Sidebar.', 'ashe-pro' ),
        'before_widget' => '<div id="%1$s" class="ashe-widget %2$s">',
        'after_widget'  => '</div>',
        'before_title'  => '<div class="widget-title"><h2>',
        'after_title'   => '</h2></div>',
    ) );
}

add_action( 'widgets_init', 'ashe_widgets_init' );
/*
**  Top Menu Fallback
*/
function ashe_top_menu_fallback() {
    if ( current_user_can( 'edit_theme_options' ) ) {
        echo '<ul id="top-menu">';
        echo '<li>';
        echo '<a href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '">' . esc_html__( 'Set up Menu', 'ashe-pro' ) . '</a>';
        echo '</li>';
        echo '</ul>';
    }
}

/*
**  Main Menu Fallback
*/
function ashe_main_menu_fallback() {
    if ( current_user_can( 'edit_theme_options' ) ) {
        echo '<ul id="main-menu">';
        echo '<li>';
        echo '<a href="' . esc_url( admin_url( 'nav-menus.php' ) ) . '">' . esc_html__( 'Set up Menu', 'ashe-pro' ) . '</a>';
        echo '</li>';
        echo '</ul>';
    }
}

/*
**  Custom Excerpt Length
*/
function ashe_excerpt_length() {
    return 2000;
}

add_filter( 'excerpt_length', 'ashe_excerpt_length', 999 );
function ashe_new_excerpt(  $more  ) {
    return '...';
}

add_filter( 'excerpt_more', 'ashe_new_excerpt' );
if ( !function_exists( 'ashe_excerpt' ) ) {
    function ashe_excerpt(  $limit = 50  ) {
        echo '<p>' . wp_trim_words( get_the_excerpt(), $limit ) . '</p>';
    }

}
/*
** Custom Functions
*/
// Include Theme Defaults
require get_parent_theme_file_path( '/inc/customizer/customizer-defaults.php' );
// Page Layouts
function ashe_page_layout() {
    // WooCommerce check
    $shop_page = false;
    if ( class_exists( 'WooCommerce' ) ) {
        $shop_page = is_shop() || is_product_category();
    }
    // get layout
    if ( $shop_page ) {
        return ashe_options( 'general_shop_layout' );
    } elseif ( is_page() ) {
        return substr( ashe_options( 'general_home_layout' ), 0, 4 ) . '-rsidebarlrsidebar';
    } elseif ( is_home() ) {
        return ashe_options( 'general_home_layout' );
    } elseif ( is_single() ) {
        return ashe_options( 'general_single_layout' );
    } else {
        return ashe_options( 'general_other_layout' );
    }
}

add_action( 'wp', 'ashe_page_layout' );
// HEX to RGBA Converter
function ashe_hex2rgba(  $color, $opacity = 1  ) {
    // remove '#' from string
    $color = substr( $color, 1 );
    // get values from string
    $hex = array($color[0] . $color[1], $color[2] . $color[3], $color[4] . $color[5]);
    // convert HEX to RGB
    $rgb = array_map( 'hexdec', $hex );
    // convert HEX to RGBA
    $output = 'rgba(' . implode( ",", $rgb ) . ', ' . $opacity . ')';
    return $output;
}

// Retrieves the attachment src from the file URL
function ashe_get_image_src_by_url(  $image_url, $image_size  ) {
    if ( !isset( $image_url ) || '' === $image_url ) {
        return [
            0 => null,
        ];
    } else {
        return wp_get_attachment_image_src( attachment_url_to_postid( $image_url ), $image_size );
    }
}

// Get Thumbnail
if ( !function_exists( 'ashe_post_thumbnail' ) ) {
    function ashe_post_thumbnail() {
        if ( has_post_thumbnail() ) {
            if ( strpos( ashe_page_layout(), 'col1' ) === 0 || is_single() ) {
                the_post_thumbnail( 'ashe-full-thumbnail' );
            } else {
                if ( strpos( ashe_page_layout(), 'list' ) === 0 ) {
                    the_post_thumbnail( 'ashe-list-thumbnail' );
                } else {
                    the_post_thumbnail( 'ashe-grid-thumbnail' );
                }
            }
        }
    }

}
// Get Featured Slider, Carousel
if ( !function_exists( 'ashe_featured_slider' ) ) {
    function ashe_featured_slider() {
        if ( ashe_options( 'featured_slider_source' ) === 'posts' ) {
            get_template_part( 'templates/header/featured', 'slider' );
        } else {
            get_template_part( 'templates/header/featured', 'slider-custom' );
        }
    }

}
// Social Media
if ( !function_exists( 'ashe_social_media' ) ) {
    function ashe_social_media(  $social_class = ''  ) {
        ?>

		<div class="<?php 
        echo esc_attr( $social_class );
        ?>">

			<?php 
        $social_window = ( ashe_options( 'social_media_window' ) === true ? '_blank' : '_self' );
        if ( ashe_options( 'social_media_url_1' ) !== '' ) {
            ?>

			<a href="<?php 
            echo esc_url( ashe_options( 'social_media_url_1' ) );
            ?>" target="<?php 
            echo esc_attr( $social_window );
            ?>" aria-label="<?php 
            echo ashe_options( 'social_media_icon_1' );
            ?>">
					<?php 
            ashe_social_media_icon( '1' );
            ?>
			</a>
			<?php 
        }
        ?>

			<?php 
        if ( ashe_options( 'social_media_url_2' ) !== '' ) {
            ?>
				<a href="<?php 
            echo esc_url( ashe_options( 'social_media_url_2' ) );
            ?>" target="<?php 
            echo esc_attr( $social_window );
            ?>"  aria-label="<?php 
            echo ashe_options( 'social_media_icon_2' );
            ?>">
					<?php 
            ashe_social_media_icon( '2' );
            ?>
				</a>
			<?php 
        }
        ?>

			<?php 
        if ( ashe_options( 'social_media_url_3' ) !== '' ) {
            ?>
				<a href="<?php 
            echo esc_url( ashe_options( 'social_media_url_3' ) );
            ?>" target="<?php 
            echo esc_attr( $social_window );
            ?>"  aria-label="<?php 
            echo ashe_options( 'social_media_icon_3' );
            ?>">
					<?php 
            ashe_social_media_icon( '3' );
            ?>
				</a>
			<?php 
        }
        ?>

			<?php 
        if ( ashe_options( 'social_media_url_4' ) !== '' ) {
            ?>
				<a href="<?php 
            echo esc_url( ashe_options( 'social_media_url_4' ) );
            ?>" target="<?php 
            echo esc_attr( $social_window );
            ?>"  aria-label="<?php 
            echo ashe_options( 'social_media_icon_4' );
            ?>">
					<?php 
            ashe_social_media_icon( '4' );
            ?>
				</a>
			<?php 
        }
        ?>

			<?php 
        if ( ashe_options( 'social_media_url_5' ) !== '' ) {
            ?>
				<a href="<?php 
            echo esc_url( ashe_options( 'social_media_url_5' ) );
            ?>" target="<?php 
            echo esc_attr( $social_window );
            ?>"  aria-label="<?php 
            echo ashe_options( 'social_media_icon_5' );
            ?>">
					<?php 
            ashe_social_media_icon( '5' );
            ?>
				</a>
			<?php 
        }
        ?>

			<?php 
        if ( ashe_options( 'social_media_url_6' ) !== '' ) {
            ?>
				<a href="<?php 
            echo esc_url( ashe_options( 'social_media_url_6' ) );
            ?>" target="<?php 
            echo esc_attr( $social_window );
            ?>"  aria-label="<?php 
            echo ashe_options( 'social_media_icon_6' );
            ?>">
					<?php 
            ashe_social_media_icon( '6' );
            ?>
				</a>
			<?php 
        }
        ?>

			<?php 
        if ( ashe_options( 'social_media_url_7' ) !== '' ) {
            ?>
				<a href="<?php 
            echo esc_url( ashe_options( 'social_media_url_7' ) );
            ?>" target="<?php 
            echo esc_attr( $social_window );
            ?>"  aria-label="<?php 
            echo ashe_options( 'social_media_icon_7' );
            ?>">
					<?php 
            ashe_social_media_icon( '7' );
            ?>
				</a>
			<?php 
        }
        ?>

			<?php 
        if ( ashe_options( 'social_media_url_8' ) !== '' ) {
            ?>
				<a href="<?php 
            echo esc_url( ashe_options( 'social_media_url_8' ) );
            ?>" target="<?php 
            echo esc_attr( $social_window );
            ?>"  aria-label="<?php 
            echo ashe_options( 'social_media_icon_8' );
            ?>">
					<?php 
            ashe_social_media_icon( '8' );
            ?>
				</a>
			<?php 
        }
        ?>

		</div>

	<?php 
    }

    // ashe_social_media()
    function ashe_social_media_icon(  $icon  ) {
        $icon = ashe_options( 'social_media_icon_' . $icon );
        $social_icons_fab = array(
            'facebook-f',
            'facebook',
            'twitter',
            'twitter-square',
            'google',
            'linkedin-in',
            'linkedin',
            'pinterest',
            'pinterest-p',
            'pinterest-square',
            'tiktok',
            'behance',
            'behance-square',
            'tumblr',
            'tumblr-square',
            'reddit',
            'reddit-alien',
            'reddit-square',
            'dribbble',
            'vk',
            'odnoklassniki',
            'skype',
            'youtube',
            'youtube-square',
            'vimeo-v',
            'vimeo',
            'twitch',
            'soundcloud',
            'instagram',
            'flickr',
            'github',
            'github-alt',
            'github-square',
            'stack-overflow',
            'qq',
            'weibo',
            'weixin',
            'xing',
            'xing-square',
            'medium',
            'etsy',
            'snapchat',
            'snapchat-ghost',
            'snapchat-square',
            'spotify',
            'meetup',
            'amazon',
            'paypal',
            'cc-paypal',
            'cc-visa',
            'goodreads',
            'goodreads-g'
        );
        $social_icons_fas = array(
            'film',
            'rss',
            'heart',
            'gamepad',
            'envelope',
            'book',
            'tablet-alt',
            'credit-card',
            'user-circle',
            'bookmark',
            'user',
            'comments',
            'phone',
            'shopping-cart',
            'info',
            'info-circle',
            'map-marker-alt'
        );
        if ( in_array( $icon, $social_icons_fab ) ) {
            echo '<i class="fab fa-' . $icon . '"></i>';
        }
        if ( in_array( $icon, $social_icons_fas ) ) {
            echo '<i class="fas fa-' . $icon . '"></i>';
        }
        if ( $icon === 'fa-x-twitter' ) {
            echo '<i class="fa-brands fa-x-twitter"></i>';
        }
    }

}
// Related Posts
if ( !function_exists( 'ashe_related_posts' ) ) {
    function ashe_related_posts(  $title, $orderby  ) {
        global $post;
        $current_categories = get_the_category();
        if ( $current_categories ) {
            $first_category = $current_categories[0]->term_id;
            // Random
            if ( $orderby === 'random' ) {
                $args = array(
                    'post_type'           => 'post',
                    'post__not_in'        => array($post->ID),
                    'orderby'             => 'rand',
                    'posts_per_page'      => 3,
                    'ignore_sticky_posts' => 1,
                    'meta_query'          => array(array(
                        'key'     => '_thumbnail_id',
                        'compare' => 'EXISTS',
                    )),
                );
                // Similar
            } else {
                $args = array(
                    'post_type'           => 'post',
                    'category__in'        => array($first_category),
                    'post__not_in'        => array($post->ID),
                    'orderby'             => 'rand',
                    'posts_per_page'      => 3,
                    'ignore_sticky_posts' => 1,
                    'meta_query'          => array(array(
                        'key'     => '_thumbnail_id',
                        'compare' => 'EXISTS',
                    )),
                );
            }
            $similar_posts = new WP_Query($args);
            if ( $similar_posts->have_posts() ) {
                ?>

			<div class="related-posts">
				<h3><?php 
                echo esc_html( $title );
                ?></h3>

				<?php 
                while ( $similar_posts->have_posts() ) {
                    $similar_posts->the_post();
                    if ( has_post_thumbnail() ) {
                        ?>
					<section>
						<a href="<?php 
                        echo esc_url( get_the_permalink() );
                        ?>"><?php 
                        the_post_thumbnail( 'ashe-grid-thumbnail' );
                        ?></a>
						<h4><a href="<?php 
                        echo esc_url( get_the_permalink() );
                        ?>"><?php 
                        the_title();
                        ?></a></h4>
						<span class="related-post-date"><?php 
                        echo get_the_time( get_option( 'date_format' ) );
                        ?></span>
					</section>

				<?php 
                    }
                    // end if
                }
                // end while
                ?>

				<div class="clear-fix"></div>
			</div>

			<?php 
            }
            // end have_posts()
        }
        // if ( $current_categories )
        wp_reset_postdata();
    }

    // ashe_related_posts()
}
// function_exists( 'ashe_related_posts' )
/*
** Custom Search Form
*/
function ashe_custom_search_form(  $html  ) {
    $html = '<form role="search" method="get" id="searchform" class="clear-fix" action="' . esc_url( home_url( '/' ) ) . '">';
    $html .= '<input type="search" name="s" id="s" placeholder="' . esc_attr__( 'Search...', 'ashe-pro' ) . '" data-placeholder="' . esc_attr__( 'Type & hit Enter...', 'ashe-pro' ) . '" value="' . get_search_query() . '" />';
    $html .= '<span class="svg-fa-wrap"><i class="fa-solid fa-magnifying-glass"></i></span>';
    $html .= '<input type="submit" id="searchsubmit" value="st" />';
    $html .= '</form>';
    return $html;
}

add_filter( 'get_search_form', 'ashe_custom_search_form' );
/*
**  Facebook Sharing Meta
*/
function ashe_meta_sharing() {
    global $post;
    $post_id = get_the_ID();
    $temp = $post;
    $post = get_post( $post_id );
    setup_postdata( $post );
    $excerpt = wp_trim_words( get_the_excerpt() );
    wp_reset_postdata();
    $post = $temp;
    $fb_image = wp_get_attachment_image_src( get_post_thumbnail_id( $post_id ), 'large' );
    if ( has_custom_logo() ) {
        $fb_default_image = wp_get_attachment_url( get_theme_mod( 'custom_logo' ) );
    } else {
        $fb_default_image = get_header_image();
    }
    if ( defined( 'WPSEO_VERSION' ) || defined( 'RANK_MATH_VERSION' ) || defined( 'AIOSEO_PHP_VERSION_DIR' ) ) {
        return;
    }
    // Home Page
    if ( !is_single() && !is_page() ) {
        echo '<meta property="og:image" content="' . $fb_default_image . '"/>';
        echo '<meta property="og:title" content="' . get_bloginfo( 'name' ) . '"/>';
        echo '<meta property="og:description" content="' . get_bloginfo( 'description' ) . '" />';
        echo '<meta property="og:url" content="' . get_site_url() . '/" />';
        // Other Pages
    } else {
        if ( isset( $fb_image ) && has_post_thumbnail( $post_id ) ) {
            echo '<meta property="og:image" content="' . $fb_image[0] . '"/>';
            echo '<meta property="og:image:width" content="' . $fb_image[1] . '"/>';
            echo '<meta property="og:image:height" content="' . $fb_image[2] . '"/>';
        } else {
            echo '<meta property="og:image" content="' . $fb_default_image . '"/>';
        }
        echo '<meta property="og:title" content="' . get_the_title() . '"/>';
        echo '<meta property="og:description" content="' . $excerpt . '" />';
        echo '<meta property="og:url" content="' . esc_url( get_permalink() ) . '"/>';
    }
    echo '<meta property="og:type" content="website">';
    echo '<meta property="og:locale" content="' . strtolower( str_replace( '-', '_', get_bloginfo( 'language' ) ) ) . '" />';
    echo '<meta property="og:site_name" content="' . get_bloginfo( 'name' ) . '"/>';
}

add_action( 'wp_head', 'ashe_meta_sharing' );
// remove_action( 'wp_head', 'ashe_meta_sharing' );
/*
**  Post Share
*/
if ( !function_exists( 'ashe_post_sharing' ) ) {
    function ashe_post_sharing() {
        global $post;
        ?>	
	      <div class="post-share">

		    <?php 
        if ( ashe_options( 'blog_page_show_facebook' ) ) {
            $facebook_src = 'https://www.facebook.com/sharer/sharer.php?u=' . esc_url( get_the_permalink() );
            ?>
		    <a class="facebook-share" target="_blank" href="<?php 
            echo esc_url( $facebook_src );
            ?>">
			<i class="fab fa-facebook-f"></i>
		</a>
		<?php 
        }
        ?>

		<?php 
        if ( ashe_options( 'blog_page_show_twitter' ) ) {
            $twitter_src = 'https://twitter.com/intent/tweet?url=' . esc_url( get_the_permalink() );
            ?>
		<a class="twitter-share" target="_blank" href="<?php 
            echo esc_url( $twitter_src );
            ?>">
			<i class="fab fa-x-twitter"></i>
		</a>
		<?php 
        }
        ?>

		<?php 
        if ( ashe_options( 'blog_page_show_pinterest' ) ) {
            $pinterest_src = 'https://pinterest.com/pin/create/button/?url=' . esc_url( get_the_permalink() ) . '&amp;media=' . esc_url( wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ) ) . '&amp;description=' . get_the_title();
            ?>
		<a class="pinterest-share" target="_blank" href="<?php 
            echo esc_url( $pinterest_src );
            ?>">
			<i class="fab fa-pinterest"></i>
		</a>
		<?php 
        }
        ?>

		<?php 
        if ( ashe_options( 'blog_page_show_whatsapp' ) ) {
            $google_src = 'https://api.whatsapp.com/send?text=*' . get_the_title() . '*\\n' . esc_html( get_the_excerpt() ) . '\\n' . esc_url( get_the_permalink() );
            ?>
		<a class="whatsapp-share" target="_blank" href="<?php 
            echo esc_url( $google_src );
            ?>">
			<i class="fa-brands fa-square-whatsapp"></i>
		</a>										
		<?php 
        }
        ?>

		<?php 
        if ( ashe_options( 'blog_page_show_linkedin' ) ) {
            $linkedin_src = 'http://www.linkedin.com/shareArticle?url=' . esc_url( get_the_permalink() ) . '&amp;title=' . get_the_title();
            ?>
		<a class="linkedin-share" target="_blank" href="<?php 
            echo esc_url( $linkedin_src );
            ?>">
			<i class="fab fa-linkedin-in"></i>
		</a>
		<?php 
        }
        ?>

		<?php 
        if ( ashe_options( 'blog_page_show_tumblr' ) ) {
            $tumblr_src = 'http://www.tumblr.com/share/link?url=' . urlencode( esc_url( get_permalink() ) ) . '&amp;name=' . urlencode( get_the_title() ) . '&amp;description=' . urlencode( wp_trim_words( get_the_excerpt(), 50 ) );
            ?>
		<a class="tumblr-share" target="_blank" href="<?php 
            echo esc_url( $tumblr_src );
            ?>">
			<i class="fab fa-tumblr"></i>
		</a>
		<?php 
        }
        ?>

		<?php 
        if ( ashe_options( 'blog_page_show_reddit' ) ) {
            $reddit_src = 'http://reddit.com/submit?url=' . esc_url( get_the_permalink() ) . '&amp;title=' . get_the_title();
            ?>
		<a class="reddit-share" target="_blank" href="<?php 
            echo esc_url( $reddit_src );
            ?>">
			<i class="fab fa-reddit"></i>
		</a>
		<?php 
        }
        ?>

	</div>
	<?php 
    }

}
/*
** Comments Form Section
*/
if ( !function_exists( 'ashe_comments' ) ) {
    function ashe_comments(  $comment, $args, $depth  ) {
        $_GLOBAL['comment'] = $comment;
        if ( get_comment_type() == 'pingback' || get_comment_type() == 'trackback' ) {
            ?>
			
		<li class="pingback" id="comment-<?php 
            comment_ID();
            ?>">
			<article <?php 
            comment_class( 'entry-comments' );
            ?> >
				<div class="comment-content">
					<h3 class="comment-author"><?php 
            esc_html_e( 'Pingback:', 'ashe-pro' );
            ?></h3>	
					<div class="comment-meta">		
						<a class="comment-date" href=" <?php 
            echo esc_url( get_comment_link() );
            ?> "><?php 
            comment_date( get_option( 'date_format' ) );
            esc_html_e( '&nbsp;at&nbsp;', 'ashe-pro' );
            comment_time( get_option( 'time_format' ) );
            ?></a>
						<?php 
            echo edit_comment_link( esc_html__( '[Edit]', 'ashe-pro' ) );
            ?>
						<div class="clear-fix"></div>
					</div>
					<div class="comment-text">			
					<?php 
            comment_author_link();
            ?>
					</div>
				</div>
			</article>

		<?php 
        } elseif ( get_comment_type() == 'comment' ) {
            ?>

		<li id="comment-<?php 
            comment_ID();
            ?>">
			
			<article <?php 
            comment_class( 'entry-comments' );
            ?> >					
				<div class="comment-avatar">
					<?php 
            $avatar_size = 75;
            if ( $comment->comment_parent != 0 ) {
                $avatar_size = 70;
            }
            echo get_avatar( $comment, $avatar_size );
            ?>
				</div>
				<div class="comment-content">
					<h3 class="comment-author"><?php 
            comment_author_link();
            ?></h3>
					<div class="comment-meta">		
						<a class="comment-date" href=" <?php 
            echo esc_url( get_comment_link() );
            ?> "><?php 
            comment_date( get_option( 'date_format' ) );
            esc_html_e( '&nbsp;at&nbsp;', 'ashe-pro' );
            comment_time( get_option( 'time_format' ) );
            ?></a>
			
						<?php 
            echo edit_comment_link( esc_html__( '[Edit]', 'ashe-pro' ) );
            comment_reply_link( array_merge( $args, array(
                'depth'     => $depth,
                'max_depth' => $args['max_depth'],
            ) ) );
            ?>
						
						<div class="clear-fix"></div>
					</div>

					<div class="comment-text">
						<?php 
            if ( $comment->comment_approved == '0' ) {
                ?>
						<p class="awaiting-moderation"><?php 
                esc_html_e( 'Your comment is awaiting moderation.', 'ashe-pro' );
                ?></p>
						<?php 
            }
            ?>
						<?php 
            comment_text();
            ?>
					</div>
				</div>
				
			</article>

		<?php 
        }
    }

}
// Move Comments Textarea
function ashe_move_comments_field(  $fields  ) {
    // unset/set
    $comment_field = $fields['comment'];
    unset($fields['comment']);
    $fields['comment'] = $comment_field;
    return $fields;
}

add_filter( 'comment_form_fields', 'ashe_move_comments_field' );
/*
**  Author Social
*/
function ashe_contactmethods(  $contactmethods  ) {
    $contactmethods['facebook'] = esc_html__( 'Facebook', 'ashe-pro' );
    $contactmethods['twitter'] = esc_html__( 'Twitter', 'ashe-pro' );
    $contactmethods['instagram'] = esc_html__( 'Instagram', 'ashe-pro' );
    $contactmethods['pinterest'] = esc_html__( 'Pinterest', 'ashe-pro' );
    $contactmethods['bloglovin'] = esc_html__( 'Bloglovin', 'ashe-pro' );
    $contactmethods['tumblr'] = esc_html__( 'Tumblr', 'ashe-pro' );
    $contactmethods['youtube'] = esc_html__( 'Youtube', 'ashe-pro' );
    $contactmethods['vine'] = esc_html__( 'Vine', 'ashe-pro' );
    $contactmethods['flickr'] = esc_html__( 'Flickr', 'ashe-pro' );
    $contactmethods['linkedin'] = esc_html__( 'Linkedin', 'ashe-pro' );
    $contactmethods['behance'] = esc_html__( 'Behance', 'ashe-pro' );
    $contactmethods['soundcloud'] = esc_html__( 'Soundcloud', 'ashe-pro' );
    $contactmethods['vimeo'] = esc_html__( 'Vimeo', 'ashe-pro' );
    $contactmethods['twitch'] = esc_html__( 'Twitch', 'ashe-pro' );
    $contactmethods['rss'] = esc_html__( 'Rss', 'ashe-pro' );
    $contactmethods['dribbble'] = esc_html__( 'Dribbble', 'ashe-pro' );
    $contactmethods['envelope'] = esc_html__( 'Envelope', 'ashe-pro' );
    return $contactmethods;
}

add_filter(
    'user_contactmethods',
    'ashe_contactmethods',
    10,
    1
);
/*
** WooCommerce
*/
if ( class_exists( 'WooCommerce' ) ) {
    // get shop page ID
    $shop_page_id = get_option( 'woocommerce_shop_page_id' );
    // wrap woocommerce content - start
    function ashe_woocommerce_output_content_wrapper() {
        $shop_page_id = get_option( 'woocommerce_shop_page_id' );
        $sidebars = ( is_shop() || is_product_category() ? ashe_page_layout() : '' );
        $layout = ( get_field( 'full_width_page_content', $shop_page_id ) !== 'yes' ? ' boxed-wrapper' : '' );
        echo '<div class="main-content clear-fix' . $layout . '" data-layout="' . esc_attr( $sidebars ) . '">';
        // Sidebar Left
        if ( is_shop() || is_product_category() ) {
            get_template_part( 'templates/sidebars/sidebar-shop', 'left' );
        }
        echo '<div class="main-container">';
    }

    add_action( 'woocommerce_before_main_content', 'ashe_woocommerce_output_content_wrapper', 5 );
    // wrap woocommerce content - end
    function ashe_woocommerce_output_content_wrapper_end() {
        echo '</div><!-- .main-container -->';
        // Sidebar Right
        if ( is_shop() || is_product_category() ) {
            get_template_part( 'templates/sidebars/sidebar-shop', 'right' );
        }
        echo '</div><!-- .main-content -->';
    }

    add_action( 'woocommerce_after_main_content', 'ashe_woocommerce_output_content_wrapper_end', 50 );
    // Remove Default Sidebar
    remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 );
    // Change product grid columns
    if ( !function_exists( 'ashe_woocommerce_grid_columns' ) ) {
        function ashe_woocommerce_grid_columns() {
            if ( is_product() ) {
                return;
            }
            if ( is_shop() || is_product_taxonomy() || is_product_category() || is_product_tag() ) {
                $columns = substr( ashe_options( 'general_shop_layout' ), 3, 1 );
                return $columns;
            }
        }

    }
    add_filter( 'loop_shop_columns', 'ashe_woocommerce_grid_columns' );
    // Change related products grid columns
    add_filter( 'woocommerce_output_related_products_args', 'ashe_related_products_args' );
    function ashe_related_products_args(  $args  ) {
        $args['posts_per_page'] = 3;
        $args['columns'] = 3;
        return $args;
    }

    // Remove Breadcrumbs
    if ( !function_exists( 'ashe_remove_wc_breadcrumbs' ) ) {
        function ashe_remove_wc_breadcrumbs() {
            remove_action(
                'woocommerce_before_main_content',
                'woocommerce_breadcrumb',
                20,
                0
            );
        }

    }
    add_action( 'init', 'ashe_remove_wc_breadcrumbs' );
    // Shop Per Page Field
    function ashe_shop_posts_per_page() {
        add_settings_section(
            'reading_settings_section',
            '',
            '',
            'reading'
        );
        add_settings_field(
            'shop_posts_per_page',
            esc_html__( 'Shop pages show at most', 'ashe-pro' ),
            'ashe_shop_posts_per_page_callback',
            'reading',
            'reading_settings_section',
            array(esc_html__( 'posts', 'ashe-pro' ))
        );
        register_setting( 'reading', 'shop_posts_per_page' );
    }

    add_action( 'admin_init', 'ashe_shop_posts_per_page' );
    function ashe_shop_posts_per_page_callback(  $args  ) {
        $value = ( get_option( 'shop_posts_per_page' ) ? get_option( 'shop_posts_per_page' ) : 9 );
        echo '<input type="number" id="shop_posts_per_page" name="shop_posts_per_page" value="' . $value . '" class="small-text"/>';
        echo '<label for="shop_posts_per_page"> ' . $args[0] . '</label>';
    }

    // Shop Per Page
    function ashe_set_shop_post_per_page(  $cols  ) {
        $cols = ( get_option( 'shop_posts_per_page' ) ? get_option( 'shop_posts_per_page' ) : 9 );
        return $cols;
    }

    add_filter( 'loop_shop_per_page', 'ashe_set_shop_post_per_page', 20 );
    // Pagination Old
    // remove_action( 'woocommerce_pagination', 'woocommerce_pagination', 10 );
    // function woocommerce_pagination()
    // {
    //     get_template_part( 'templates/grid/blog', 'pagination' );
    // }
    // add_action( 'woocommerce_pagination', 'woocommerce_pagination', 10 );
    // Pagination New
    function custom_woocommerce_pagination() {
        get_template_part( 'templates/grid/blog', 'pagination' );
    }

    remove_action( 'woocommerce_after_shop_loop', 'woocommerce_pagination', 10 );
    add_action( 'woocommerce_after_shop_loop', 'custom_woocommerce_pagination', 10 );
}
// end check - woocommerce is active
/*
** Boxed Style
*/
function ashe_boxed_style() {
    if ( true === ashe_options( 'general_boxed_style' ) ) {
        echo '
		<style id="ashe_boxed_style">
			.featured-slider-area #featured-slider,
			#featured-links {
			  background: #fff;
			  padding: 30px;
			  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
			  border-radius: 3px
			}

			#featured-links {
			  padding-top: 10px;
			  margin-top: 30px
			}

			.page-content #featured-links,
			.page-content #featured-links h6 {
			  background: #fff;
			}

			#featured-links,
			.featured-slider-area {
			  margin-left: 30px;
			  margin-right: 30px
			}

			#featured-links.boxed-wrapper,
			.featured-slider-area.boxed-wrapper {
			  margin-left: auto;
			  margin-right: auto
			}

			.featured-slider-area {
			  padding-top: 40px
			}

			.featured-slider-area #featured-slider .prev-arrow {
			  left: 35px
			}

			.featured-slider-area #featured-slider .next-arrow {
			  right: 35px
			}

			.featured-slider-area #featured-slider .slider-dots {
			  bottom: 35px
			}

			.main-content,
			.featured-slider-area {
			  background: transparent!important
			}

			.blog-grid .related-posts {
			  border-bottom: 0;
			  padding-bottom: 0;
			  border-top: 1px solid #e8e8e8;
			  margin-top: 30px;
			  padding-top: 40px
			}

			.main-content[data-layout*="list"] .blog-grid .related-posts {
			  background: #fff;
			  border-top: 0;
			  padding: 30px;
			  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
			  margin-right: 3px;
			  margin-bottom: 3px;
			  border-radius: 3px
			}

			.post-footer {
			  border-bottom: 0;
			  padding-bottom: 0
			}

			.author-description,
			.comments-area,
			article.post,
			article.blog-post,
			.single .related-posts,
			.page-content article.page {
			  background: #fff;
			  padding: 30px;
			  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
			  margin: 3px;
			  border-radius: 3px
			}

			article.blog-post.sticky {
			  background: #efefef
			}

			.author-description {
			  margin-top: 30px
			}

			.single .related-posts {
			  margin-top: 30px
			}

			.comments-area {
			  margin-top: 30px
			}

			.sidebar-left .ashe-widget,
			.sidebar-right .ashe-widget {
			  background: #fff;
			  padding: 20px;
			  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
			  border-radius: 3px
			}

			.wp-calendar-table td {
			  padding: 7px
			}

			#page-footer {
			  background: #fff;
			  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1)
			}

			.page-footer-inner.boxed-wrapper {
			  margin-bottom: 30px
			}

			.featured-slider-area.boxed-wrapper,
			.main-content.boxed-wrapper {
			  padding-left: 0!important;
			  padding-right: 0!important
			}

			.category-description{background:#fff;padding:30px;border-bottom:0;box-shadow:1px 1px 3px rgba(0,0,0,0.1);border-radius:3px}

			.blog-grid li:last-child {
			  margin-bottom: 0!important
			}

			[data-layout*="list"] .blog-grid>li {
			  padding-bottom: 0!important;
			  border-bottom: 0
			}

			.blog-pagination {
			  background: #fff;
			  margin: 30px 3px 3px;
			  padding: 30px;
			  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1)
			}

			.blog-pagination.numeric .numeric-next-page,
			.blog-pagination.numeric .numeric-prev-page {
			  top: 30px
			}

			.blog-pagination.numeric .numeric-next-page {
			  right: 30px
			}

			.blog-pagination.numeric .numeric-prev-page {
			  left: 30px
			}

			main#main {
			  background: #fff;
			  padding: 30px;
			  margin: 3px;
			  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
			  border-radius: 3px
			}

			main#main .blog-pagination {
			  margin-bottom: 0;
			  box-shadow: none;
			}

			@media screen and ( max-width: 1170px) {
			  #featured-links,
			  .featured-slider-area {
			    margin-left: auto;
			    margin-right: auto
			  }
			  .main-content {
			    padding-left: 0;
			    padding-right: 0
			  }
			  .page-content,
			  #page-footer {
			    padding: 0 20px
			  }
			}

			@media screen and ( max-width: 979px) {
			  .featured-slider-area.boxed-wrapper #featured-slider {
			    margin-top: 30px!important
			  }
			  .sidebar-right-wrap .sidebar-right,
			  .sidebar-right-wrap .sidebar-left {
			    margin-top: 30px
			  }
			  .sidebar-right .ashe-widget:last-child {
			    margin-bottom: 0
			  }
			}

			@media screen and (max-width: 768px) {
			  #featured-links {
			    padding-top: 30px;
			  }

			  #featured-links .featured-link {
			    margin-top: 0 !important;
			  }
			}

			@media screen and (max-width: 640px) {
			  .featured-slider-area #featured-slider,
			  #featured-links,
			  .author-description,
			  .comments-area,
			  article.post,
			  article.blog-post,
			  .single .related-posts,
			  .page-content article.page,
			  .blog-pagination,
			  main#main {
			    padding: 20px
			  }
			  .main-content {
			    padding-top: 30px;
			    padding-bottom: 30px
			  }
			  .ashe-widget {
			    margin-bottom: 30px
			  }

			  .blog-pagination.numeric .numeric-next-page,
			  .blog-pagination.numeric .numeric-prev-page {
			    top: 20px;
			  }

			  .sidebar-left-wrap,
			  .sidebar-right-wrap,
			  .footer-widgets .ashe-widget {
			  	width: 100% !important;
			  }
			}

			@media screen and (max-width: 480px) {
			  .main-content {
			    padding-left: 0!important;
			    padding-right: 0!important
			  }
			}
		</style>';
        // Add Boxed Body Class
        add_filter( 'body_class', function ( $classes ) {
            return array_merge( $classes, array('ashe-boxed-style') );
        } );
    }
}

add_action( 'wp_head', 'ashe_boxed_style', 10000 );
/*
** Integrate ACF PRO
*/
function my_acf_settings_path(  $path  ) {
    $path = get_template_directory() . '/plugins/acf-pro/';
    return $path;
}

add_filter( 'acf/settings/path', 'my_acf_settings_path' );
function my_acf_settings_dir(  $dir  ) {
    $dir = get_template_directory_uri() . '/plugins/acf-pro/';
    return $dir;
}

add_filter( 'acf/settings/dir', 'my_acf_settings_dir' );
include_once get_template_directory() . '/plugins/acf-pro/acf.php';
// Enable WordPress Custom Fields
add_filter( 'acf/settings/remove_wp_meta_box', '__return_false' );
/*
** Includes
*/
// Customizer
require get_parent_theme_file_path( '/inc/customizer/fonts/google-fonts.php' );
require get_parent_theme_file_path( '/inc/customizer/customizer-repeater/inc/customizer.php' );
require get_parent_theme_file_path( '/inc/customizer/customizer.php' );
require get_parent_theme_file_path( '/inc/customizer/dynamic-css.php' );
// Options
require get_parent_theme_file_path( '/inc/options/theme-options.php' );
require get_parent_theme_file_path( '/inc/options/theme-license.php' );
require get_parent_theme_file_path( '/inc/options/import/royal-importer.php' );
// Metaboxes
require get_parent_theme_file_path( '/inc/metaboxes/metabox.php' );
// Custom Widget
require get_parent_theme_file_path( '/inc/widgets/social-widget.php' );
require get_parent_theme_file_path( '/inc/widgets/author-widget.php' );
require get_parent_theme_file_path( '/inc/widgets/promo-box-widget.php' );
// Shortcodes
require get_parent_theme_file_path( '/inc/shortcodes/shortcodes.php' );
/*
** TGM Plugin Activation Class
*/
require_once get_parent_theme_file_path( '/inc/tgm/class-tgm-plugin-activation.php' );
function ashe_register_recommended_plugins() {
    $plugins = array(array(
        'name'     => 'Elementor',
        'slug'     => 'elementor',
        'required' => false,
    ), array(
        'name'     => 'Royal Elementor Addons',
        'slug'     => 'royal-elementor-addons',
        'required' => false,
    ));
    $config = array(
        'id'           => 'ashe-pro',
        'default_path' => '',
        'menu'         => 'tgmpa-install-plugins',
        'has_notices'  => true,
        'dismissable'  => true,
        'dismiss_msg'  => '',
        'is_automatic' => false,
        'message'      => '',
    );
    tgmpa( $plugins, $config );
}

add_action( 'tgmpa_register', 'ashe_register_recommended_plugins' );