', esc_url(get_bloginfo('pingback_url'))); } } add_action('wp_head', 'bloglex_pingback_header'); if (!function_exists('bloglex_get_page_layout')) : /** * Get Page Layout based on the post meta or customizer value * * @return string Page Layout. * @since 1.0.0 * */ function bloglex_get_page_layout() { global $post; $page_layout = ''; // For homepage regardless of static page or latest posts. if (is_front_page() || is_home()) { return bloglex_get_option('sidebar_layout_option'); } // Fetch from Post Meta on single posts or pages. if ($post && is_singular()) { $page_layout = get_post_meta($post->ID, 'bloglex_page_layout', true); if (empty($page_layout) && is_single()) { $page_layout = bloglex_get_option('single_post_layout'); } } // Fetch from customizer if everything else fails. if (empty($page_layout)) { $page_layout = bloglex_get_option('single_sidebar_layout_option'); } return $page_layout; } endif; if (!function_exists('bloglex_load_fonts_url')) : //Google Fonts URL function bloglex_load_fonts_url() { $font_families = array( 'Cormorant+Garamond:wght@300;400;500;600;700', 'Mulish:wght@200..1000', 'Oooh+Baby', ); $fonts_url = add_query_arg(array( 'family' => implode('&family=', $font_families), 'display' => 'swap', ), 'https://fonts.googleapis.com/css2'); return esc_url_raw($fonts_url); } endif; if (!function_exists('bloglex_placeholder_image')) : /** * Get placeholder image * * @since 1.0.0 */ function bloglex_placeholder_image() { $src = get_template_directory_uri() . '/assets/images/placeholder.png'; return apply_filters('bloglex_placeholder_image', $src); } endif; if (!function_exists('bloglex_get_archive_excerpt')) : /** * Get archive excerpt * * @return string Page ID. * @since 1.0.0 * */ function bloglex_get_archive_excerpt() { $number_of_word_in_excerpt = bloglex_get_option('number_of_word_in_excerpt', 25); return wp_trim_words(get_the_excerpt(), $number_of_word_in_excerpt, '…'); } endif; if (!function_exists('bloglex_the_archive_excerpt')) : /** * Print archive excerpt * * @return string Page ID. * @since 1.0.0 * */ function bloglex_the_archive_excerpt() { $excerpt_posts_title_limit = bloglex_get_option('excerpt_posts_title_limit'); ?>