urlencode(implode('|', $font_families)),
'subset' => urlencode('latin,latin-ext'),
);
$fonts_url = add_query_arg($query_args, 'https://fonts.googleapis.com/css');
return esc_url_raw($fonts_url);
}
function blog_x_enqueue_child_styles()
{
wp_enqueue_style('blogx-google-font', blog_x_fonts_url(), array(), null);
wp_enqueue_style('blogx-parent-style', get_template_directory_uri() . '/style.css', array('slicknav', 'xblog-google-font', 'xblog-style'), '', 'all');
wp_enqueue_style('blogx-main', get_stylesheet_directory_uri() . '/assets/css/main.css', array(), BLOGX_VERSION, 'all');
wp_enqueue_script('blogx-mobile-menu', get_stylesheet_directory_uri() . '/assets/js/mobile-menu.js', array('jquery'), BLOGX_VERSION, true);
wp_enqueue_script('blogx-main-js', get_stylesheet_directory_uri() . '/assets/js/xmain.js', array('jquery'), BLOGX_VERSION, true);
}
add_action('wp_enqueue_scripts', 'blog_x_enqueue_child_styles');
if (!function_exists('blog_x_posted_on')) :
/**
* Prints HTML with meta information for the current post-date/time and author.
*/
function blog_x_posted_on()
{
$time_string = '';
if (get_the_time('U') !== get_the_modified_time('U')) {
$time_string = ' | ';
}
$time_string = sprintf(
$time_string,
esc_attr(get_the_date('c')),
esc_html(get_the_date()),
esc_attr(get_the_modified_date('c')),
esc_html(get_the_modified_date())
);
$posted_on = sprintf(
/* translators: %s: post date. */
esc_html_x('- %s', 'post date', 'blog-x'),
'' . $time_string . ''
);
$byline = sprintf(
/* translators: %s: post author. */
esc_html_x('- %s', 'post author', 'blog-x'),
'' . esc_html(get_the_author()) . ''
);
echo '' . wp_kses_post($posted_on) . ' ' . wp_kses_post($byline) . '';
}
endif;
/**
* Customizer additions.
*/
require get_stylesheet_directory() . '/inc/customizer.php';
if (!function_exists('blog_x_inline_css')) :
function blog_x_inline_css()
{
$blog_x_grid_height = get_theme_mod('blog_x_grid_height', 750);
$blog_x_posts_image = get_theme_mod('blog_x_posts_image', '1');
$blog_x_posts_blank_image = get_theme_mod('blog_x_posts_blank_image', '1');
$style = '';
if ($blog_x_posts_image == '1' && $blog_x_posts_blank_image == '1') {
if ($blog_x_grid_height != 750) {
$style .= '.site-main article.xgrid-item{min-height:' . esc_attr($blog_x_grid_height) . 'px}';
}
}
if ($blog_x_posts_image != '1') {
$style .= '.site-main article.xgrid-item{min-height:auto;padding-bottom:30px;}';
}
wp_add_inline_style('blogx-main', $style);
}
add_action('wp_enqueue_scripts', 'blog_x_inline_css');
endif;
function blog_x_excerpt_length($length)
{
if (is_admin()) return $length;
return 30;
}
add_filter('excerpt_length', 'blog_x_excerpt_length', 999);
function blog_x_excerpt_more($more)
{
if (is_admin()) return $more;
return ' ...';
}
add_filter('excerpt_more', 'blog_x_excerpt_more');
/**
* Customizer additions.
*/
require_once get_stylesheet_directory() . '/inc/mobile-menu.php';