implode( '&family=', $font_families ), 'display' => 'swap', ), 'https://fonts.googleapis.com/css2' ); return esc_url_raw($fonts_url); } endif; if( !function_exists( 'sakka_social_menu_icon' ) ) : function sakka_social_menu_icon( $item_output, $item, $depth, $args ) { // Add Icon if ( isset( $args->theme_location ) && 'sakka-social-menu' === $args->theme_location ) { $svg = Sakka_SVG_Icons::get_theme_svg_name( $item->url ); if ( empty( $svg ) ) { $svg = sakka_the_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', 'sakka_social_menu_icon', 10, 4 ); if ( ! function_exists( 'sakka_sub_menu_toggle_button' ) ) : function sakka_sub_menu_toggle_button( $args, $item, $depth ) { // Add sub menu toggles to the main menu with toggles if ( $args->theme_location == 'sakka-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 == 'sakka-primary-menu' ) { if ( in_array( 'menu-item-has-children', $item->classes ) ) { $args->before = ''; } else { $args->before = ''; $args->after = ''; } } return $args; } endif; add_filter( 'nav_menu_item_args', 'sakka_sub_menu_toggle_button', 10, 3 ); /** * Sakka SVG Icon helper functions * * @package Sakka * @since 1.0.0 */ if ( ! function_exists( 'sakka_the_theme_svg' ) ): /** * Output and Get Theme SVG. * Output and get the SVG markup for an icon in the Sakka_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 sakka_the_theme_svg( $svg_name, $return = false ) { if( $return ){ return sakka_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in sakka_get_theme_svg();. }else{ echo sakka_get_theme_svg( $svg_name ); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in sakka_get_theme_svg();. } } endif; if ( ! function_exists( 'sakka_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 sakka_get_theme_svg( $svg_name ) { // Make sure that only our allowed tags and attributes are included. $svg = wp_kses( Sakka_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, ), 'polyline' => array( 'fill' => true, 'points' => true, ), 'line' => array( 'fill' => true, 'x1' => true, 'x2' => true, 'y1' => true, 'y2' => true, ), ) ); if ( ! $svg ) { return false; } return $svg; } endif; if( !function_exists( 'sakka_post_category_list' ) ) : // Post Category List. function sakka_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 --','sakka' ); } 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('sakka_sanitize_meta_pagination') ): /** Sanitize Enable Disable Checkbox **/ function sakka_sanitize_meta_pagination( $input ) { $valid_keys = array('global-layout','no-navigation','theme-normal-navigation','ajax-next-post-load'); if ( in_array( $input , $valid_keys ) ) { return $input; } return ''; } endif; if( !function_exists('sakka_disable_post_views') ): /** Disable Post Views **/ function sakka_disable_post_views() { add_filter('booster_extension_filter_views_ed', 'sakka_disable_post_views_callback'); } endif; if( !function_exists('sakka_disable_post_views_callback') ): /** Disable Reaction **/ function sakka_disable_post_views_callback() { return false; } endif; if( !function_exists('sakka_disable_post_read_time') ): /** Disable Read Time **/ function sakka_disable_post_read_time() { add_filter('booster_extension_filter_readtime_ed', 'sakka_disable_post_read_time_callback'); } endif; if( !function_exists('sakka_disable_post_read_time_callback') ): /** Disable Reaction **/ function sakka_disable_post_read_time_callback() { return false; } endif; if( !function_exists('sakka_disable_post_like_dislike') ): /** Disable Like Dislike **/ function sakka_disable_post_like_dislike() { add_filter('booster_extension_filter_like_ed', 'sakka_disable_post_like_dislike_callback'); } endif; if( !function_exists('sakka_disable_post_like_dislike_callback') ): /** Disable Reaction **/ function sakka_disable_post_like_dislike_callback() { return false; } endif; if( !function_exists('sakka_disable_post_author_box') ): /** Disable Author Box **/ function sakka_disable_post_author_box() { add_filter('booster_extension_filter_ab_ed', 'sakka_disable_post_author_box_callback'); } endif; if( !function_exists('sakka_disable_post_author_box_callback') ): /** Disable Reaction **/ function sakka_disable_post_author_box_callback() { return false; } endif; add_filter('booster_extension_filter_ss_ed', 'sakka_disable_post_social_share_callback'); if( !function_exists('sakka_disable_post_social_share_callback') ): /** Disable Reaction **/ function sakka_disable_post_social_share_callback() { return false; } endif; if( !function_exists('sakka_disable_post_reaction') ): /** Disable Reaction **/ function sakka_disable_post_reaction() { add_filter( 'booster_extension_filter_reaction_ed', 'sakka_disable_post_reaction_callback' ); } endif; if( !function_exists('sakka_disable_post_reaction_callback') ): /** Disable Reaction **/ function sakka_disable_post_reaction_callback() { return false; } endif; if( !function_exists('sakka_post_floating_nav') ): function sakka_post_floating_nav(){ $sakka_default = sakka_get_default_theme_options(); $ed_floating_next_previous_nav = get_theme_mod( 'ed_floating_next_previous_nav',$sakka_default['ed_floating_next_previous_nav'] ); if( 'post' === get_post_type() && $ed_floating_next_previous_nav ){ $next_post = get_next_post(); $prev_post = get_previous_post(); if( isset( $prev_post->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', $sakka_default['twp_navigation_type']); } if( $twp_navigation_type != 'no-navigation' && 'post' === get_post_type() ){ if( $twp_navigation_type == 'theme-normal-navigation' ){ ?> ID ) ){ $next_post_id = $next_post->ID; echo '
'; } } } } endif; add_action( 'sakka_navigation_action','sakka_single_post_navigation',30 ); if ( ! function_exists( 'sakka_header_toggle_search' ) ): /** * Header Search **/ function sakka_header_toggle_search() { ?>
'sakka-social-menu', 'link_before' => '', 'link_after' => '', 'container' => 'div', 'container_class' => 'social-menu', 'depth' => 1, )); ?>
'post', 'posts_per_page' => 4,'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $sakka_header_banner_cat ) ) ); if( $banner_query->have_posts() ): ?>
'post', 'posts_per_page' => 10,'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html( $sakka_carousel_section_cat ) ) ); if( $banner_query->have_posts() ): ?>

'post', 'posts_per_page' => 3,'post__not_in' => get_option("sticky_posts") ) ); if( $lead_post_query ->have_posts() ): ?>
have_posts() ){ $lead_post_query->the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); ?>
ID; if( is_single() && 'post' === get_post_type() ){ $cats = get_the_category( $post->ID ); $category = array(); if( $cats ){ foreach( $cats as $cat ){ $category[] = $cat->term_id; } } $related_posts_query = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 6, 'post__not_in' => array( $post->ID ), 'category__in' => $category ) ); $ed_related_post = absint( get_theme_mod( 'ed_related_post',$sakka_default['ed_related_post'] ) ); if( $ed_related_post && $related_posts_query->have_posts() ): ?>
'.esc_html( $title ).''; } ?>
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( 'sakka_sanitize_sidebar_option_meta' ) ) : // Sidebar Option Sanitize. function sakka_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('sakka_category_grid') ): // Single Posts Related Posts. function sakka_category_grid(){ $sakka_default = sakka_get_default_theme_options(); $ed_category_section = absint( get_theme_mod( 'ed_category_section',$sakka_default['ed_category_section'] ) ); $sakka_category_section_title = esc_html( get_theme_mod( 'sakka_category_section_title',$sakka_default['sakka_category_section_title'] ) ); if( $ed_category_section ){ $rtl = ''; if( is_rtl() ){ $rtl = 'dir="rtl"'; } ?> 'page', 'page_id' => $sakka_about_page, ); } if (!empty($sakka_about_page_args)) { $sakka_about_page_query = new WP_Query($sakka_about_page_args); while ($sakka_about_page_query->have_posts()): $sakka_about_page_query->the_post(); if (has_post_thumbnail()) { $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' => 3, 'category_name' => esc_html(get_theme_mod( 'select_category_for_related_post')), 'ignore_sticky_posts' => 1, ) ); $featured_posts_query_2 = new WP_Query( array( 'post_type' => 'post', 'posts_per_page' => 1, 'offset' => 3, 'category_name' => esc_html(get_theme_mod( 'select_category_for_related_post')), 'ignore_sticky_posts' => 1, ) ); if( $featured_posts_query->have_posts() ): ?>

"; echo esc_html($featured_post_sub_title); echo " "; }?>
have_posts()): $featured_posts_query->the_post(); if (has_post_thumbnail()) { $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium_large'); $featured_image = isset($featured_image[0]) ? $featured_image[0] : ''; }?> have_posts() ): while ($featured_posts_query_2->have_posts()): $featured_posts_query_2->the_post(); if (has_post_thumbnail()) { $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'medium_large'); $featured_image = isset($featured_image[0]) ? $featured_image[0] : ''; }?>