urlencode( implode( '|', $font_families ) ), 'subset' => urlencode( 'latin,latin-ext' ), ); $fonts_url = add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ); } return $fonts_url; } endif; /*----------------------------------------------------------------------------------------------------------------*/ /** * Enqueue scripts and styles. */ function editorial_scripts() { global $editorial_version; wp_enqueue_style( 'font-awesome', get_template_directory_uri().'/assets/library/font-awesome/css/font-awesome.min.css', array(), '4.7.0' ); wp_enqueue_style( 'editorial-google-font', editorial_fonts_url(), array(), null ); wp_enqueue_style( 'editorial-style', get_stylesheet_uri(), array(), esc_attr( $editorial_version ) ); wp_enqueue_style( 'editorial-responsive', get_template_directory_uri().'/assets/css/editorial-responsive.css', array(), esc_attr( $editorial_version ) ); wp_enqueue_script( 'jquery-bxslider', get_template_directory_uri() . '/assets/library/bxslider/jquery.bxslider.min.js', array( 'jquery' ), '4.2.12', true ); $menu_sticky_option = get_theme_mod( 'editorial_sticky_option', 'enable' ); if ( $menu_sticky_option != 'disable' ) { wp_enqueue_script( 'jquery-sticky', get_template_directory_uri(). '/assets/library/sticky/jquery.sticky.js', array( 'jquery' ), '20150416', true ); wp_enqueue_script( 'editorial-sticky-menu-setting', get_template_directory_uri(). '/assets/library/sticky/sticky-setting.js', array( 'jquery-sticky' ), '20150309', true ); } wp_enqueue_script( 'editorial-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), esc_attr( $editorial_version ), true ); wp_enqueue_script( 'editorial-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), esc_attr( $editorial_version ), true ); wp_enqueue_script( 'editorial-custom-script', get_template_directory_uri() . '/assets/js/custom-script.js', array( 'jquery' ), esc_attr( $editorial_version ), true ); if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); } } add_action( 'wp_enqueue_scripts', 'editorial_scripts' ); /*----------------------------------------------------------------------------------------------------------------*/ /** * Current date at top header */ add_action( 'editorial_current_date', 'editorial_current_date_hook' ); if( ! function_exists( 'editorial_current_date_hook' ) ): function editorial_current_date_hook() { $date_option = get_theme_mod( 'editorial_header_date', 'enable' ); if( $date_option != 'disable' ) { ?>
have_posts() ) { echo '
    '; while( $ticker_query->have_posts() ) { $ticker_query->the_post(); ?>
  • '; } ?>
0 ) ); foreach ( $editorial_categories as $editorial_category ) { $editorial_category_array[$editorial_category->term_id] = $editorial_category->cat_name; } return $editorial_category_array; } endif; /** * categories in dropdown * * @since 1.2.3 */ if( ! function_exists( 'editorial_category_dropdown' ) ) : function editorial_category_dropdown() { $editorial_categories = get_categories( array( 'hide_empty' => 0 ) ); $editorial_category_dropdown['0'] = __( 'Select Category', 'editorial' ); foreach ( $editorial_categories as $editorial_category ) { $editorial_category_dropdown[$editorial_category->term_id] = $editorial_category->cat_name; } return $editorial_category_dropdown; } endif; //no of columns $editorial_grid_columns = array( '' => __( 'Select No. of Columns', 'editorial' ), '2' => __( '2 Columns', 'editorial' ), '3' => __( '3 Columns', 'editorial' ), '4' => __( '4 Columns', 'editorial' ) ); /*----------------------------------------------------------------------------------------------------------------*/ /** * Custom function for wp_query args */ if( ! function_exists( 'editorial_query_args' ) ): function editorial_query_args( $cat_id, $post_count = null ) { if( !empty( $cat_id ) ) { $editorial_args = array( 'post_type' => 'post', 'cat' => absint( $cat_id ), 'posts_per_page'=> intval( $post_count ) ); } else { $editorial_args = array( 'post_type' => 'post', 'posts_per_page'=> intval( $post_count ), 'ignore_sticky_posts' => 1 ); } return $editorial_args; } endif; /*----------------------------------------------------------------------------------------------------------------*/ /** * block widget title */ if( ! function_exists( 'editorial_block_title' ) ): function editorial_block_title( $block_title, $block_cat_id ) { $block_cat_name = get_cat_name( $block_cat_id ); $cat_id_class = ''; if( !empty( $block_cat_id ) ) { $cat_id_class = 'mt-cat-'. esc_attr( $block_cat_id ); $cat_link = get_category_link( $block_cat_id ); } if( !empty( $block_title ) ) { $mt_widget_title = $block_title; } elseif( !empty( $block_cat_name ) ) { $mt_widget_title = $block_cat_name; } else { $mt_widget_title = ''; } ?>

ID; $categories_list = get_the_category( $post_id ); if( !empty( $categories_list ) ) { ?>
name; $cat_id = $cat_data->term_id; $cat_link = get_category_link( $cat_id ); ?>
'; } if( !empty( $social_tw_link ) ) { echo ''; } if( !empty( $social_gp_link ) ) { echo ''; } if( !empty( $social_lnk_link ) ) { echo ''; } if( !empty( $social_yt_link ) ) { echo ''; } if( !empty( $social_vm_link ) ) { echo ''; } if( !empty( $social_pin_link ) ) { echo ''; } if( !empty( $social_insta_link ) ) { echo ''; } } endif; /*----------------------------------------------------------------------------------------------------------------*/ /** * Top header social icon section */ add_action( 'editorial_top_social_icons', 'editorial_top_social_icons_hook' ); if( ! function_exists('editorial_top_social_icons_hook' ) ): function editorial_top_social_icons_hook() { $top_social_icons = get_theme_mod( 'editorial_header_social_option', 'enable' ); if( $top_social_icons != 'disable' ) { ?>
object ){ $category = get_category( $item->object_id ); $classes[] = 'mt-cat-' . esc_attr( $category->term_id ); } return $classes; } add_filter( 'nav_menu_css_class', 'editorial_category_nav_class', 10, 2 ); /*----------------------------------------------------------------------------------------------------------------*/ /** * Generate darker color * Source: http://stackoverflow.com/questions/3512311/how-to-generate-lighter-darker-color-with-php */ if( ! function_exists( 'editorial_hover_color' ) ) : function editorial_hover_color( $hex, $steps ) { // Steps should be between -255 and 255. Negative = darker, positive = lighter $steps = max( -255, min( 255, $steps ) ); // Normalize into a six character long hex string $hex = str_replace( '#', '', $hex ); if ( strlen( $hex ) == 3) { $hex = str_repeat( substr( $hex,0,1 ), 2 ).str_repeat( substr( $hex, 1, 1 ), 2 ).str_repeat( substr( $hex,2,1 ), 2 ); } // Split into three parts: R, G and B $color_parts = str_split( $hex, 2 ); $return = '#'; foreach ( $color_parts as $color ) { $color = hexdec( $color ); // Convert to decimal $color = max( 0, min( 255, $color + $steps ) ); // Adjust color $return .= str_pad( dechex( $color ), 2, '0', STR_PAD_LEFT ); // Make two char hex code } return $return; } endif; /*----------------------------------------------------------------------------------------------------------------*/ /** * Function define about page/post/archive sidebar */ if( ! function_exists( 'editorial_sidebar' ) ): function editorial_sidebar() { global $post; if( is_single() || is_page() ) { $sidebar_meta_option = get_post_meta( $post->ID, 'editorial_sidebar_location', true ); } if( is_home() ) { $set_id = get_option( 'page_for_posts' ); $sidebar_meta_option = get_post_meta( $set_id, 'editorial_sidebar_location', true ); } if( empty( $sidebar_meta_option ) || is_archive() || is_search() ) { $sidebar_meta_option = 'default_sidebar'; } $editorial_archive_sidebar = get_theme_mod( 'editorial_archive_sidebar', 'right_sidebar' ); $editorial_post_default_sidebar = get_theme_mod( 'editorial_default_post_sidebar', 'right_sidebar' ); $editorial_page_default_sidebar = get_theme_mod( 'editorial_default_page_sidebar', 'right_sidebar' ); if( $sidebar_meta_option == 'default_sidebar' ) { if( is_single() ) { if( $editorial_post_default_sidebar == 'right_sidebar' ) { get_sidebar(); } elseif( $editorial_post_default_sidebar == 'left_sidebar' ) { get_sidebar( 'left' ); } } elseif( is_page() ) { if( $editorial_page_default_sidebar == 'right_sidebar' ) { get_sidebar(); } elseif( $editorial_page_default_sidebar == 'left_sidebar' ) { get_sidebar( 'left' ); } } elseif( $editorial_archive_sidebar == 'right_sidebar' ) { get_sidebar(); } elseif( $editorial_archive_sidebar == 'left_sidebar' ) { get_sidebar( 'left' ); } } elseif( $sidebar_meta_option == 'right_sidebar' ) { get_sidebar(); } elseif( $sidebar_meta_option == 'left_sidebar' ) { get_sidebar( 'left' ); } } endif; /*----------------------------------------------------------------------------------------------------------------*/ /** * Get author info */ add_action( 'editorial_author_box', 'editorial_author_box_hook' ); if( ! function_exists('editorial_author_box_hook') ): function editorial_author_box_hook() { global $post; $author_id = $post->post_author; $author_avatar = get_avatar( $author_id, '132' ); $author_nickname = get_the_author_meta( 'display_name' ); $editorial_author_option = get_theme_mod( 'editorial_author_box_option', 'show' ); if( $editorial_author_option != 'hide' ) { ?>