implode('&family=', $font_families), 'display' => 'swap', ), 'https://fonts.googleapis.com/css2'); return esc_url_raw($fonts_url); } endif; if (!function_exists('silvermountain_sanitize_sidebar_option_meta')) : // Sidebar Option Sanitize. function silvermountain_sanitize_sidebar_option_meta($input) { $metabox_options = array('global-sidebar', 'left-sidebar', 'right-sidebar', 'no-sidebar'); if (in_array($input, $metabox_options)) { return $input; } else { return ''; } } endif; if (!function_exists('silvermountain_page_lists')) : // Page List. function silvermountain_page_lists() { $page_lists = array(); $page_lists[''] = esc_html__('-- Select Page --', 'silvermountain'); $pages = get_pages( array( 'parent' => 0, // replaces 'depth' => 1, ) ); foreach ($pages as $page) { $page_lists[$page->ID] = $page->post_title; } return $page_lists; } endif; if (!function_exists('silvermountain_sanitize_post_layout_option_meta')) : // Sidebar Option Sanitize. function silvermountain_sanitize_post_layout_option_meta($input) { $metabox_options = array('global-layout', 'layout-1', 'layout-2'); if (in_array($input, $metabox_options)) { return $input; } else { return ''; } } endif; if (!function_exists('silvermountain_sanitize_header_overlay_option_meta')) : // Sidebar Option Sanitize. function silvermountain_sanitize_header_overlay_option_meta($input) { $metabox_options = array('global-layout', 'enable-overlay'); if (in_array($input, $metabox_options)) { return $input; } else { return ''; } } endif; /** * SilverMountain SVG Icon helper functions * * @package SilverMountain * @since 1.0.0 */ if (!function_exists('silvermountain_theme_svg')): /** * Output and Get Theme SVG. * Output and get the SVG markup for an icon in the SilverMountain_SVG_Icons class. * * @param string $svg_name The name of the icon. * @param string $group The group the icon belongs to. * @param string $color Color code. */ function silvermountain_theme_svg($svg_name, $return = false) { if ($return) { return silvermountain_get_theme_svg($svg_name); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in silvermountain_get_theme_svg();. } else { echo silvermountain_get_theme_svg($svg_name); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in silvermountain_get_theme_svg();. } } endif; if (!function_exists('silvermountain_get_theme_svg')): /** * Get information about the SVG icon. * * @param string $svg_name The name of the icon. * @param string $group The group the icon belongs to. * @param string $color Color code. */ function silvermountain_get_theme_svg($svg_name) { // Make sure that only our allowed tags and attributes are included. $svg = wp_kses( SilverMountain_SVG_Icons::get_svg($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, ), 'line' => array( 'stroke' => true, 'x1' => true, 'x2' => true, 'y1' => true, 'y2' => true, ), ) ); if (!$svg) { return false; } return $svg; } endif; if (!function_exists('silvermountain_svg_escape')): /** * Get information about the SVG icon. * * @param string $svg_name The name of the icon. * @param string $group The group the icon belongs to. * @param string $color Color code. */ function silvermountain_svg_escape($input) { // Make sure that only our allowed tags and attributes are included. $svg = wp_kses( $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 (!$svg) { return false; } return $svg; } endif; if (!function_exists('silvermountain_social_menu_icon')) : function silvermountain_social_menu_icon($item_output, $item, $depth, $args) { // Add Icon if (isset($args->theme_location) && 'silvermountain-social-menu' === $args->theme_location) { $svg = SilverMountain_SVG_Icons::get_theme_svg_name($item->url); if (empty($svg)) { $svg = silvermountain_theme_svg('link', $return = true); } $item_output = str_replace($args->link_after, '' . $svg, $item_output); } return $item_output; } endif; add_filter('walker_nav_menu_start_el', 'silvermountain_social_menu_icon', 10, 4); if (!function_exists('silvermountain_sub_menu_toggle_button')) : function silvermountain_sub_menu_toggle_button($args, $item, $depth) { // Add sub menu toggles to the main menu with toggles if ($args->theme_location == 'silvermountain-primary-menu' && isset($args->show_toggles)) { // Wrap the menu item link contents in a div, used for positioning $args->before = ''; // Add sub menu icons to the main menu without toggles (the fallback menu) } elseif ($args->theme_location == 'silvermountain-primary-menu') { if (in_array('menu-item-has-children', $item->classes)) { $args->before = ''; } else { $args->before = ''; $args->after = ''; } } return $args; } add_filter('nav_menu_item_args', 'silvermountain_sub_menu_toggle_button', 10, 3); endif; if (!function_exists('silvermountain_post_category_list')) : // Post Category List. function silvermountain_post_category_list($select_cat = true) { $post_cat_lists = get_categories( array( 'hide_empty' => '0', 'exclude' => '1', ) ); $post_cat_cat_array = array(); if ($select_cat) { $post_cat_cat_array[''] = esc_html__('Select Category', 'silvermountain'); } foreach ($post_cat_lists as $post_cat_list) { $post_cat_cat_array[$post_cat_list->slug] = $post_cat_list->name; } return $post_cat_cat_array; } endif; if (!function_exists('silvermountain_sanitize_meta_pagination')): /** Sanitize Enable Disable Checkbox **/ function silvermountain_sanitize_meta_pagination($input) { $valid_keys = array('global-layout', 'no-navigation', 'norma-navigation', 'ajax-next-post-load'); if (in_array($input, $valid_keys)) { return $input; } return ''; } endif; if (!function_exists('silvermountain_disable_post_views')): /** Disable Post Views **/ function silvermountain_disable_post_views() { add_filter('booster_extension_filter_views_ed', 'silvermountain_disable_views_ed'); } endif; if (!function_exists('silvermountain_disable_views_ed')): /** Disable Reaction **/ function silvermountain_disable_views_ed() { return false; } endif; if (!function_exists('silvermountain_disable_post_read_time')): /** Disable Read Time **/ function silvermountain_disable_post_read_time() { add_filter('booster_extension_filter_readtime_ed', 'silvermountain_disable_read_time'); } endif; if (!function_exists('silvermountain_disable_read_time')): /** Disable Reaction **/ function silvermountain_disable_read_time() { return false; } endif; if (!function_exists('silvermountain_disable_post_like_dislike')): /** Disable Like Dislike **/ function silvermountain_disable_post_like_dislike() { add_filter('booster_extension_filter_like_ed', 'silvermountain_disable_like_ed'); } endif; if (!function_exists('silvermountain_disable_like_ed')): /** Disable Reaction **/ function silvermountain_disable_like_ed() { return false; } endif; if (!function_exists('silvermountain_disable_post_author_box')): /** Disable Author Box **/ function silvermountain_disable_post_author_box() { add_filter('booster_extension_filter_ab_ed', 'silvermountain_disable_ab_ed'); } endif; if (!function_exists('silvermountain_disable_ab_ed')): /** Disable Reaction **/ function silvermountain_disable_ab_ed() { return false; } endif; add_filter('booster_extension_filter_ss_ed', 'silvermountain_disable_social_share'); if (!function_exists('silvermountain_disable_social_share')): /** Disable Reaction **/ function silvermountain_disable_social_share() { return false; } endif; if (!function_exists('silvermountain_disable_post_reaction')): /** Disable Reaction **/ function silvermountain_disable_post_reaction() { add_filter('booster_extension_filter_reaction_ed', 'silvermountain_disable_reaction_cb'); } endif; if (!function_exists('silvermountain_disable_reaction_cb')): /** Disable Reaction **/ function silvermountain_disable_reaction_cb() { return false; } endif; if (!function_exists('silvermountain_header_ad')): function silvermountain_header_ad() { $silvermountain_default = silvermountain_get_default_theme_options(); $ed_header_ad = get_theme_mod('ed_header_ad', $silvermountain_default['ed_header_ad']); $header_ad_image = get_theme_mod('header_ad_image'); $ed_header_link = get_theme_mod('ed_header_link'); if ($ed_header_ad) { ?>
<?php esc_attr_e('Header AD Image', 'silvermountain'); ?>
ID)) { $prev_link = get_permalink($prev_post->ID); ?>
ID, 'medium')) { ?> ID, 'medium')); ?> ID)); ?>
ID)) { $next_link = get_permalink($next_post->ID); ?>
ID, 'medium')) { ?> ID, 'medium')); ?> ID)); ?>
ID; if ($twp_navigation_type == '' || $twp_navigation_type == 'global-layout') { $twp_navigation_type = get_theme_mod('twp_navigation_type', $silvermountain_default['twp_navigation_type']); } if ($silvermountain_header_trending_page != $current_id && $silvermountain_header_popular_page != $current_id) { if ($twp_navigation_type != 'no-navigation' && 'post' === get_post_type()) { if ($twp_navigation_type == 'norma-navigation') { ?> ID)) { $next_post_id = $next_post->ID; echo '
'; } } } } } endif; add_action('silvermountain_navigation_action', 'silvermountain_single_post_navigation', 30); if (!function_exists('silvermountain_header_banner')): function silvermountain_header_banner() { global $post; if (have_posts()): while (have_posts()) : the_post(); global $post; endwhile; endif; $silvermountain_post_layout = ''; $silvermountain_default = silvermountain_get_default_theme_options(); if (is_singular()) { $silvermountain_post_layout = esc_html(get_post_meta($post->ID, 'silvermountain_post_layout', true)); if ($silvermountain_post_layout == '' || $silvermountain_post_layout == 'global-layout') { $silvermountain_post_layout = get_theme_mod('silvermountain_single_post_layout', $silvermountain_default['silvermountain_archive_layout']); } } if (isset($post->ID)) { $silvermountain_page_layout = esc_html(get_post_meta($post->ID, 'silvermountain_page_layout', true)); } if ($silvermountain_post_layout == 'layout-2' && is_singular('post')) { if (have_posts()) : while (have_posts()) : the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); $silvermountain_ed_feature_image = esc_html(get_post_meta(get_the_ID(), 'silvermountain_ed_feature_image', true)); ?>
'silvermountain-social-menu', 'link_before' => '', 'link_after' => '', 'container' => 'div', 'container_class' => 'silvermountain-social-menu', 'depth' => 1, ) ); ?>
'post', 'posts_per_page' => 9, 'post__not_in' => get_option("sticky_posts"), 'category_name' => $silvermountain_header_trending_cat, ) ); if ($trending_news_query->have_posts()): ?>
'post', 'posts_per_page' => 2, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html($category), 'post_status' => 'publish' ) ); $tab_post_query_1 = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 2, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html($category), 'post_status' => 'publish' ) ); if ($tab_post_query->have_posts()): ?>
have_posts()) { $tab_post_query->the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium_large'); $featured_image = isset($featured_image[0]) ? $featured_image[0] : ''; ?>
>

'post', 'posts_per_page' => 5, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html($silvermountain_header_ticker_cat))); if ($ticker_posts_query->have_posts()): ?>
have_posts()): $ticker_posts_query->the_post(); ?>
'; echo '
'; } endif; if (!function_exists('silvermountain_woo_after_main_content')): function silvermountain_woo_after_main_content() { $silvermountain_default = silvermountain_get_default_theme_options(); $sidebar = esc_attr(get_theme_mod('global_sidebar_layout', $silvermountain_default['global_sidebar_layout'])); if ($sidebar != 'no-sidebar') { get_sidebar(); } echo '
'; echo ''; } endif; if (!function_exists('silvermountain_content_loading')) { function silvermountain_content_loading() { ?>
'', 'echo' => false )); $after_content = $pagination_single . $after_content; return $after_content; } endif; if (!function_exists('main_navigation_extras')): function main_navigation_extras() { $silvermountain_default = silvermountain_get_default_theme_options(); $ed_header_trending_news = get_theme_mod('ed_header_trending_news', $silvermountain_default['ed_header_trending_news']); ?>

'; $defaults['title_reply_after'] = '

'; return $defaults; } endif; if (class_exists('Booster_Extension_Class')): add_filter('booster_extension_ed_content', 'silvermountain_read_letter_content_false'); if (!function_exists('silvermountain_read_letter_content_false')): function silvermountain_read_letter_content_false() { return false; } endif; add_action('booster_extension_read_later_post_content', 'silvermountain_readletter_content', 20); if (!function_exists('silvermountain_readletter_content')): function silvermountain_readletter_content() { return get_template_part('template-parts/content', get_post_format()); } endif; endif; if (!function_exists('silvermountain_category_pin_posts_link')): function silvermountain_category_pin_posts_link() { $silvermountain_default = silvermountain_get_default_theme_options(); $ed_post_read_later = get_theme_mod('ed_post_read_later', $silvermountain_default['ed_post_read_later']); if ($ed_post_read_later && class_exists('Booster_Extension_Class')): if (function_exists('booster_extension_get_read_letter_page_id')) { $page_id = booster_extension_get_read_letter_page_id(); if ($page_id) { $page_link = get_page_link($page_id); ?>
1) $opacity = 1.0; $output = 'rgba(' . implode(",", $rgb) . ',' . $opacity . ')'; } else { $output = 'rgb(' . implode(",", $rgb) . ')'; } //Return rgb(a) color string return $output; } if (!function_exists('silvermountain_asidebar_section')): function silvermountain_asidebar_section() { $silvermountain_default = silvermountain_get_default_theme_options(); $asidebar_section_tab_title_1 = get_theme_mod('asidebar_section_tab_title_1', $silvermountain_default['asidebar_section_tab_title_1']); $asidebar_section_tab_category_1 = get_theme_mod('asidebar_section_tab_category_1'); $asidebar_section_tab_title_2 = get_theme_mod('asidebar_section_tab_title_2', $silvermountain_default['asidebar_section_tab_title_2']); $asidebar_section_tab_category_2 = get_theme_mod('asidebar_section_tab_category_2'); if ($asidebar_section_tab_category_1) { $tab_section_query_1 = new WP_Query(array('post_type' => 'post', 'posts_per_page' => 10, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html($asidebar_section_tab_category_1))); } else { $asidebar_section_tab_category_1 = esc_html__("Popular", 'silvermountain'); $tab_section_query_1 = new WP_Query(array('post_type' => 'post', 'posts_per_page' => 10, 'post__not_in' => get_option("sticky_posts"), 'orderby' => 'comment_count')); } if ($asidebar_section_tab_category_2) { $tab_section_query_2 = new WP_Query(array('post_type' => 'post', 'posts_per_page' => 10, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html($asidebar_section_tab_category_2))); } else { $asidebar_section_tab_category_2 = esc_html__("latest", 'silvermountain'); $tab_section_query_2 = new WP_Query(array('post_type' => 'post', 'posts_per_page' => 10, 'post__not_in' => get_option("sticky_posts"))); } ?>