theme_location) && 'beginner-blog-social-menu' === $args->theme_location) { $svg = Beginner_Blog_SVG_Icons::get_theme_svg_name($item->url); if (empty($svg)) { $svg = beginner_blog_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', 'beginner_blog_social_menu_icon', 10, 4); if (!function_exists('beginner_blog_sub_menu_toggle_button')) : function beginner_blog_sub_menu_toggle_button($args, $item, $depth) { // Add sub menu toggles to the main menu with toggles if ($args->theme_location == 'beginner-blog-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 == 'beginner-blog-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', 'beginner_blog_sub_menu_toggle_button', 10, 3); /** * Beginner Blog SVG Icon helper functions * * @package Beginner Blog * @since 1.0.0 */ if (!function_exists('beginner_blog_the_theme_svg')): /** * Output and Get Theme SVG. * Output and get the SVG markup for an icon in the Beginner_Blog_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 beginner_blog_the_theme_svg($svg_name, $return = false) { if ($return) { return beginner_blog_get_theme_svg($svg_name); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in beginner_blog_get_theme_svg();. } else { echo beginner_blog_get_theme_svg($svg_name); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Escaped in beginner_blog_get_theme_svg();. } } endif; if (!function_exists('beginner_blog_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 beginner_blog_get_theme_svg($svg_name) { // Make sure that only our allowed tags and attributes are included. $svg = wp_kses( Beginner_Blog_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, ), ) ); if (!$svg) { return false; } return $svg; } endif; if (!function_exists('beginner_blog_post_category_list')) : // Post Category List. function beginner_blog_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 --', 'beginner-blog'); } 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('beginner_blog_sanitize_meta_pagination')): /** Sanitize Enable Disable Checkbox **/ function beginner_blog_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('beginner_blog_disable_post_views')): /** Disable Post Views **/ function beginner_blog_disable_post_views() { add_filter('booster_extension_filter_views_ed', 'beginner_blog_disable_post_views_callback'); } endif; if (!function_exists('beginner_blog_disable_post_views_callback')): /** Disable Reaction **/ function beginner_blog_disable_post_views_callback() { return false; } endif; if (!function_exists('beginner_blog_disable_post_read_time')): /** Disable Read Time **/ function beginner_blog_disable_post_read_time() { add_filter('booster_extension_filter_readtime_ed', 'beginner_blog_disable_post_read_time_callback'); } endif; if (!function_exists('beginner_blog_disable_post_read_time_callback')): /** Disable Reaction **/ function beginner_blog_disable_post_read_time_callback() { return false; } endif; if (!function_exists('beginner_blog_disable_post_like_dislike')): /** Disable Like Dislike **/ function beginner_blog_disable_post_like_dislike() { add_filter('booster_extension_filter_like_ed', 'beginner_blog_disable_post_like_dislike_callback'); } endif; if (!function_exists('beginner_blog_disable_post_like_dislike_callback')): /** Disable Reaction **/ function beginner_blog_disable_post_like_dislike_callback() { return false; } endif; if (!function_exists('beginner_blog_disable_post_author_box')): /** Disable Author Box **/ function beginner_blog_disable_post_author_box() { add_filter('booster_extension_filter_ab_ed', 'beginner_blog_disable_post_author_box_callback'); } endif; if (!function_exists('beginner_blog_disable_post_author_box_callback')): /** Disable Reaction **/ function beginner_blog_disable_post_author_box_callback() { return false; } endif; add_filter('booster_extension_filter_ss_ed', 'beginner_blog_disable_post_social_share_callback'); if (!function_exists('beginner_blog_disable_post_social_share_callback')): /** Disable Reaction **/ function beginner_blog_disable_post_social_share_callback() { return false; } endif; if (!function_exists('beginner_blog_disable_post_reaction')): /** Disable Reaction **/ function beginner_blog_disable_post_reaction() { add_filter('booster_extension_filter_reaction_ed', 'beginner_blog_disable_post_reaction_callback'); } endif; if (!function_exists('beginner_blog_disable_post_reaction_callback')): /** Disable Reaction **/ function beginner_blog_disable_post_reaction_callback() { return false; } endif; if (!function_exists('beginner_blog_post_floating_nav')): function beginner_blog_post_floating_nav() { $beginner_blog_default = beginner_blog_get_default_theme_options(); $ed_floating_next_previous_nav = get_theme_mod('ed_floating_next_previous_nav', $beginner_blog_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_large')) { ?> ID, 'medium_large')); ?> ID)); ?>
ID)) { $next_link = get_permalink($next_post->ID); ?>
ID, 'medium_large')) { ?> ID, 'medium_large')); ?> ID)); ?>
ID; if ($twp_navigation_type == '' || $twp_navigation_type == 'global-layout') { $twp_navigation_type = get_theme_mod('twp_navigation_type', $beginner_blog_default['twp_navigation_type']); } if ($twp_navigation_type != 'no-navigation' && 'post' === get_post_type()) { ?>
ID)) { $next_post_id = $next_post->ID; echo '
'; } } ?>
'beginner-blog-social-menu', 'link_before' => '', 'link_after' => '', 'container' => 'div', 'container_class' => 'social-menu', 'depth' => 1, )); ?>
array( 'background_color' => $beginner_blog_default['beginner_blog_background_color'], 'beginner_blog_bg_color_1' => $beginner_blog_default['beginner_blog_beginner_blog_bg_color_1'], 'beginner_blog_bg_color_2' => $beginner_blog_default['beginner_blog_beginner_blog_bg_color_2'], 'beginner_blog_bg_color_3' => $beginner_blog_default['beginner_blog_beginner_blog_bg_color_3'], 'beginner_blog_bg_color_4' => $beginner_blog_default['beginner_blog_beginner_blog_bg_color_4'], 'beginner_blog_primary_color' => $beginner_blog_default['beginner_blog_primary_color'], 'beginner_blog_secondary_color' => $beginner_blog_default['beginner_blog_secondary_color'], ), 'dark' => array( 'background_color' => $beginner_blog_default['beginner_blog_background_color_dark'], 'beginner_blog_bg_color_dark_1' => $beginner_blog_default['beginner_blog_beginner_blog_bg_color_dark_1'], 'beginner_blog_bg_color_dark_2' => $beginner_blog_default['beginner_blog_beginner_blog_bg_color_dark_2'], 'beginner_blog_bg_color_dark_3' => $beginner_blog_default['beginner_blog_beginner_blog_bg_color_dark_3'], 'beginner_blog_bg_color_dark_4' => $beginner_blog_default['beginner_blog_beginner_blog_bg_color_dark_4'], 'beginner_blog_primary_color' => $beginner_blog_default['beginner_blog_primary_color_dark'], 'beginner_blog_secondary_color' => $beginner_blog_default['beginner_blog_secondary_color_dark'], ), ); if (isset($colors_scheme[$current_color])) { return $colors_scheme[$current_color]; } return; } endif; if (!function_exists('beginner_blog_color_scheme_color_action')) : function beginner_blog_color_scheme_color_action() { if (isset($_POST['currentColor']) && sanitize_text_field(wp_unslash($_POST['currentColor']))) { $current_color = sanitize_text_field(wp_unslash($_POST['currentColor'])); $color_schemes = beginner_blog_color_scheme_color($current_color); if ($color_schemes) { echo json_encode($color_schemes); } } wp_die(); } endif; add_action('wp_ajax_nopriv_beginner_blog_color_scheme_color', 'beginner_blog_color_scheme_color_action'); add_action('wp_ajax_beginner_blog_color_scheme_color', 'beginner_blog_color_scheme_color_action'); if (!function_exists('beginner_blog_fonts_url')) : //Google Fonts URL function beginner_blog_fonts_url() { $fonts_url = ''; $fonts = array(); $beginner_blog_font = 'Gilda+Display&family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap'; $beginner_blog_fonts = array(); $beginner_blog_fonts[] = $beginner_blog_font; $beginner_blog_fonts_stylesheet = '//fonts.googleapis.com/css?family='; $i = 0; for ($i = 0; $i < count($beginner_blog_fonts); $i++) { if ('off' !== sprintf(_x('on', '%s font: on or off', 'beginner-blog'), $beginner_blog_fonts[$i])) { $fonts[] = $beginner_blog_fonts[$i]; } } if ($fonts) { $fonts_url = add_query_arg(array( 'family' => urldecode(implode('|', $fonts)), ), 'https://fonts.googleapis.com/css'); } return esc_url_raw($fonts_url); } endif; if (!function_exists('beginner_blog_main_slider')) : function beginner_blog_main_slider() { $beginner_blog_default = beginner_blog_get_default_theme_options(); $ed_header_banner = get_theme_mod('ed_header_banner', $beginner_blog_default['ed_header_banner']); $ed_banner_overlay = get_theme_mod('ed_banner_overlay', $beginner_blog_default['ed_banner_overlay']); $beginner_blog_header_banner_cat = get_theme_mod('beginner_blog_header_banner_cat'); if ($ed_header_banner) { $rtl = ''; if (is_rtl()) { $rtl = 'dir="rtl"'; } $banner_query = new WP_Query(array('post_type' => 'post', 'posts_per_page' => 4, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html($beginner_blog_header_banner_cat))); if ($banner_query->have_posts()): ?>
">
>
have_posts()): $banner_query->the_post(); $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'large'); ?>
'post', 'posts_per_page' => 10, 'post__not_in' => get_option("sticky_posts"), 'category_name' => esc_html($beginner_blog_carousel_section_cat))); if ($banner_query->have_posts()): ?>

'page', 'page_id' => $beginner_blog_about_page, ); } if (!empty($beginner_blog_about_page_args)) { $beginner_blog_about_page_query = new WP_Query($beginner_blog_about_page_args); while ($beginner_blog_about_page_query->have_posts()): $beginner_blog_about_page_query->the_post(); if (has_post_thumbnail()) { $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full'); $url = $thumb['0']; } ?>
esc_attr($number_of_testimonial), 'orderby' => 'post__in', 'post_type' => 'page', 'post__in' => $beginner_blog_testimonial_page, ); $beginner_blog_testimonial_query = new WP_Query($beginner_blog_testimonial_args); ?>

have_posts()) : while ($beginner_blog_testimonial_query->have_posts()) : $beginner_blog_testimonial_query->the_post(); if (has_post_thumbnail()) { $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'medium'); $url = $thumb['0']; } else { $url = ''; } if ($j == 1 || $j == 2) { $beginner_blog_column = "column-order-1"; $beginner_blog_column_2 = "column-order-2"; } else { $beginner_blog_column = "column-order-2"; $beginner_blog_column_2 = "column-order-1"; } if ($j == 4) { $j = 1; } else { $j++; } ?>

'page', 'page_id' => $beginner_blog_cta_page, ); } $homepage_cta_button_text = get_theme_mod('homepage_cta_button_text', $beginner_blog_default['homepage_cta_button_text']); $homepage_cta_button_text_url = get_theme_mod('homepage_cta_button_text_url', $beginner_blog_default['homepage_cta_button_text_url']); $cta_link_tab = get_theme_mod('cta_link_tab', $beginner_blog_default['cta_link_tab']); $ed_cta_image_overlay = get_theme_mod('ed_cta_image_overlay', $beginner_blog_default['ed_cta_image_overlay']); $cta_block_spacing = get_theme_mod('cta_block_spacing', $beginner_blog_default['cta_block_spacing']); $cta_block_layout = get_theme_mod('cta_block_layout', $beginner_blog_default['cta_block_layout']); if (!empty($beginner_blog_cta_page_args)) { $beginner_blog_cta_page_query = new WP_Query($beginner_blog_cta_page_args); while ($beginner_blog_cta_page_query->have_posts()): $beginner_blog_cta_page_query->the_post(); $thumb = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), 'full'); $url = isset($thumb[0]) ? $thumb[0] : ''; ?>

  • 'beginner-blog-social-menu', 'link_before' => '', 'link_after' => '', 'container' => 'div', 'container_class' => 'social-menu', 'depth' => 1, )); ?>

'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', $beginner_blog_default['ed_related_post'])); if ($ed_related_post && $related_posts_query->have_posts()): ?>
%2$s ' . beginner_blog_the_theme_svg('arrow-right', true) . '', esc_url(get_permalink(get_the_ID())), /* translators: %s: Post title. */ sprintf(__('Continue reading "%s"', 'beginner-blog'), get_the_title(get_the_ID())) ); return $link; } add_filter('excerpt_more', 'beginner_blog_excerpt_more');