' . esc_html($description) . '
'; } } } endif; /* HEADER BRANDING @since 2.0.0 ==================================================== */ if (!function_exists('amble_header_branding')) : function amble_header_branding() { $description = get_bloginfo('description', 'display'); echo '
' . wp_kses_post($amble_readmore_text) . '
'; } endif; /* MOVE READ MORE LINK OUTSIDE OF PARAGRAPHS Move the 'continue reading' link outside of paragraph. @since 2.0.0 ==================================================== */ if (!function_exists('amble_move_more_link')) : function amble_move_more_link() { $amble_readmore_text = esc_html(get_theme_mod('amble_readmore_text', esc_html__('Continue Reading...', 'amble'))); return '' . wp_kses_post($amble_readmore_text) . '
'; } add_filter('the_content_more_link', 'amble_move_more_link'); endif; /* INSERT FORMATS TO DROP DOWN - CLASSIC EDITOR @since 2.0.0 ==================================================== */ if (!function_exists('insert_formats_to_editor')) : function insert_formats_to_editor($init_array) { // Define the style_formats array $style_formats = array( // Each array child is a format with it's own settings array( 'title' => esc_html__('Extra Small', 'amble'), 'inline' => 'span', 'classes' => 'has-extra-small-font-size', 'wrapper' => true ), array( 'title' => esc_html__('Small', 'amble'), 'inline' => 'span', 'classes' => 'has-small-font-size', 'wrapper' => true ), array( 'title' => esc_html__('Medium', 'amble'), 'inline' => 'span', 'classes' => 'has-medium-font-size', 'wrapper' => true ), array( 'title' => esc_html__('Large', 'amble'), 'inline' => 'span', 'classes' => 'has-large-font-size', 'wrapper' => true ), array( 'title' => esc_html__('Extra Large', 'amble'), 'inline' => 'span', 'classes' => 'has-extra-large-font-size', 'wrapper' => true ), array( 'title' => esc_html__('Huge', 'amble'), 'inline' => 'span', 'classes' => 'has-huge-font-size', 'wrapper' => true ), array( 'title' => esc_html__('Gigantic', 'amble'), 'block' => 'span', 'classes' => 'has-gigantic-font-size', 'wrapper' => true ) ); // Insert the array, JSON ENCODED, into 'style_formats' $init_array['style_formats'] = json_encode($style_formats); return $init_array; } endif; add_filter('tiny_mce_before_init', 'insert_formats_to_editor'); /* ADD STYLE DROP DOWN TO CLASSIC EDITOR @since 2.0.0 ==================================================== */ if (!function_exists('amble_mce_buttons_2')) : function amble_mce_buttons_2($buttons) { array_unshift($buttons, 'styleselect'); return $buttons; // phpcs:ignore WordPress.Security.EscapeOutput } endif; add_filter('mce_buttons_2', 'amble_mce_buttons_2'); /* DISPLAY SVG ICONS IN MENU @since 2.0.0 ==================================================== */ function amble_nav_menu_social_icons($item_output, $item, $depth, $args) { // Change SVG icon inside social links menu if there is supported URL. if ('social' === $args->theme_location) { $svg = Amble_SVG_Icons::get_social_link_svg($item->url); if (empty($svg)) { $svg = amble_get_theme_svg('link'); } $item_output = str_replace($args->link_after, '' . $svg, $item_output); } return $item_output; // phpcs:ignore WordPress.Security.EscapeOutput } add_filter('walker_nav_menu_start_el', 'amble_nav_menu_social_icons', 10, 4); /* CONVERT HEX to RGBA @since 2.0.0 ==================================================== */ if (!function_exists('hex2rgba')) : function hex2rgba($color, $opacity = 1, $css = false) { if (empty($color)) return; $color = str_replace('#', '', $color); if (strlen($color) == 6) { $r = hexdec($color[0] . $color[1]); $g = hexdec($color[2] . $color[3]); $b = hexdec($color[4] . $color[5]); } elseif (strlen($color) == 3) { $r = hexdec($color[0] . $color[0]); $g = hexdec($color[1] . $color[1]); $b = hexdec($color[2] . $color[2]); } else { return false; } $opacity = floatval($opacity); if ($css) return 'rgba( ' . esc_attr($r) . ', ' . esc_attr($g) . ', ' . esc_attr($b) . ', ' . esc_attr($opacity) . ' )'; else return compact(esc_attr($r), esc_attr($g), esc_attr($b), esc_attr($opacity)); } endif; /* INLINE COLOUR PRESETS ====================================================*/ if (!function_exists('amble_colour_presets')) : function amble_colour_presets() { $amble_presets = get_theme_mod('amble_presets', 'preset1'); switch (esc_attr($amble_presets)) { case "preset12": echo '--amble-primary: #b16060; --amble-secondary: #854c4c; --amble-tertiary: #c35249; --amble-body: #445062;'; break; case "preset11": echo '--amble-primary: #9ea7af; --amble-secondary: #87939f; --amble-tertiary: #d56a62; --amble-body: #e4e5e7;'; break; case "preset10": echo '--amble-primary: #ba8300; --amble-secondary: #ffba19; --amble-tertiary: #2c66e5; --amble-body: #dbd6d0;'; break; case "preset9": echo '--amble-primary: #b19d8d; --amble-secondary: #9d8775; --amble-tertiary: #53a0ad; --amble-body: #6f8387;'; break; case "preset8": echo '--amble-primary: #75a558; --amble-secondary: #abdf8b; --amble-tertiary: #c5613b; --amble-body: #97a390;'; break; case "preset7": echo '--amble-primary: #bd4b6e; --amble-secondary: #e57597; --amble-tertiary: #ab3169; --amble-body: #bfb8ba;'; break; case "preset6": echo '--amble-primary: #bda74b; --amble-secondary: #ffe680; --amble-tertiary: #6e80d7; --amble-body: #d7d5cf;'; break; case "preset5": echo '--amble-primary: #3f83bd; --amble-secondary: #6ebbff; --amble-tertiary: #bd8c3e; --amble-body: #3e5466;'; break; case "preset4": echo '--amble-primary: #bd561e; --amble-secondary: #ff8442; --amble-tertiary: #1ebdb7; --amble-body: #c9d3d2;'; break; case "preset3": echo '--amble-primary: #758870; --amble-secondary: #6b7c8b; --amble-tertiary: #365647; --amble-body: #c0c9c4;'; break; case "preset2": echo '--amble-primary: #58bdad; --amble-secondary: #bd7559; --amble-tertiary: #2a7064; --amble-body: #e1e6e7;'; break; default: echo '--amble-primary: #bba579; --amble-secondary: #c6975e; --amble-tertiary: #2b789b; --amble-body: #465156;'; } } endif; /* BLOG NAVIGATION Navigation for the blog @since 2.0.0 ==================================================== */ if (!function_exists('amble_blog_nav')) : function amble_blog_nav() { the_posts_pagination(array( 'prev_text' => is_rtl() ? amble_get_theme_svg('caret-right') : amble_get_theme_svg('caret-left'), 'next_text' => is_rtl() ? amble_get_theme_svg('caret-left') : amble_get_theme_svg('caret-right'), 'before_page_number' => '' )); } endif; /* POST NAVIGATION Navigation for full posts. @since 2.0.0 ==================================================== */ if (!function_exists('amble_post_pagination')) : function amble_post_pagination() { the_post_navigation(array( 'next_text' => ' %title', 'prev_text' => ' %title', )); } endif; /* MULTIPAGE NAVIGATION Navigation for splitting posts or pages into more than one page. @since 2.0.0 ==================================================== */ if (!function_exists('amble_multipage_pagination')) : function amble_multipage_pagination() { wp_link_pages(array( 'before' => '