urlencode( implode( '|', $fonts ) ), 'subset' => urlencode( $subsets ), ), '//fonts.googleapis.com/css' ); } return $fonts_url; } } // completion of enqueue for the google font /****************************************************************************************/ add_action( 'wp_enqueue_scripts', 'bikaro_scripts_styles_method' ); /** * Register jquery scripts */ function bikaro_scripts_styles_method() { // defining the script to load the minified version of js and css file if 'SCRIPT_DEBUG' is set to true $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; /** * Loads our main stylesheet. */ wp_enqueue_style( 'bikaro_style', get_stylesheet_uri() ); // use of enqueued google fonts wp_enqueue_style( 'bikaro-google-fonts', bikaro_fonts_url(), array(), null ); if( get_theme_mod( 'bikaro_color_skin', 'light' ) == 'dark' ) { wp_enqueue_style( 'bikaro_dark_style', bikaro_CSS_URL. '/dark' . $suffix . '.css' ); } /** * Adds JavaScript to pages with the comment form to support * sites with threaded comments (when in use). */ if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); /** * Enqueue Slider setup js file. */ if ( is_front_page() && get_theme_mod( 'bikaro_activate_slider', '0' ) == '1' ) { wp_enqueue_script( 'bikaro-bxslider', bikaro_JS_URL . '/jquery.bxslider/jquery.bxslider' . $suffix . '.js', array( 'jquery' ), '4.1.2', true ); } // enqueueing stickyjs for sticky primary menu if ( get_theme_mod( 'bikaro_sticky_menu_activate', '1' ) == 1 ) { wp_enqueue_script( 'bikaro-stickyjs', bikaro_JS_URL . '/stickyjs/jquery.sticky' . $suffix . '.js', array( 'jquery' ), false, true ); } // enqueueing fitvids for responsive videos wp_enqueue_script( 'bikaro-fitvids', bikaro_JS_URL . '/fitvids/jquery.fitvids' . $suffix . '.js', array( 'jquery' ), false, true ); // enqueueing navigation file wp_enqueue_script( 'bikaro-navigation', bikaro_JS_URL . '/navigation' . $suffix . '.js', array( 'jquery' ), false, true ); // enqueueing bikaro theme custom js file wp_enqueue_script( 'bikaro-custom', bikaro_JS_URL. '/bikaro-custom' . $suffix . '.js', array( 'jquery' ) ); // enqueueing fontawesome icons wp_enqueue_style( 'bikaro-fontawesome', get_template_directory_uri().'/font-awesome/css/font-awesome' . $suffix . '.css', array(), '4.4.0' ); $bikaro_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']); if(preg_match('/(?i)msie [1-8]/',$bikaro_user_agent)) { wp_enqueue_script( 'html5', bikaro_JS_URL . '/html5shiv' . $suffix . '.js', true ); } } /****************************************************************************************/ /** * Enqueuing js for image uploader in service alternate widget */ add_action('admin_enqueue_scripts', 'bikaro_service_widget_alternate'); function bikaro_service_widget_alternate( $hook ) { // defining the script to load the minified version of js and css file if 'SCRIPT_DEBUG' is set to true $suffix = ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) ? '' : '.min'; if( $hook == 'widgets.php' || $hook == 'customize.php' ) { // enqueueing the image upload script wp_enqueue_media(); wp_enqueue_script('bikaro_service_widget_alternate', get_template_directory_uri() . '/js/image_uploader' . $suffix . '.js', false, '1.0', true); } } /****************************************************************************************/ add_filter( 'excerpt_length', 'bikaro_excerpt_length' ); /** * Sets the post excerpt length to 40 words. * * function tied to the excerpt_length filter hook. * * @uses filter excerpt_length */ function bikaro_excerpt_length( $length ) { return 40; } add_filter( 'excerpt_more', 'bikaro_continue_reading' ); /** * Returns a "Continue Reading" link for excerpts */ function bikaro_continue_reading() { return ''; } /****************************************************************************************/ /** * Removing the default style of wordpress gallery */ add_filter( 'use_default_gallery_style', '__return_false' ); /** * Filtering the size to be medium from thumbnail to be used in WordPress gallery as a default size */ function bikaro_gallery_atts( $out, $pairs, $atts ) { $atts = shortcode_atts( array( 'size' => 'medium', ), $atts ); $out['size'] = $atts['size']; return $out; } add_filter( 'shortcode_atts_gallery', 'bikaro_gallery_atts', 10, 3 ); /****************************************************************************************/ if ( ! function_exists( 'bikaro_sidebar_layout' ) ) : /** * Select and show sidebar based on post meta and customizer default settings */ function bikaro_sidebar_layout() { global $post; $layout = get_theme_mod( 'bikaro_default_layout', 'both_sidebar' ); // Get Layout meta for posts if( $post ) { $layout_meta = get_post_meta( $post->ID, 'bikaro_page_layout', true ); } // Home page if Posts page is assigned if( is_home() && !( is_front_page() ) ) { $queried_id = get_option( 'page_for_posts' ); $layout_meta = get_post_meta( $queried_id, 'bikaro_page_layout', true ); if( $layout_meta != 'default_layout' && $layout_meta != '' ) { $layout = $layout_meta; } } elseif( is_page() ) { $layout = get_theme_mod( 'bikaro_pages_default_layout', 'both_sidebar' ); if( $layout_meta != 'default_layout' && $layout_meta != '' ) { $layout = $layout_meta; } } elseif( is_single() ) { $layout = get_theme_mod( 'bikaro_single_posts_default_layout', 'both_sidebar' ); if( $layout_meta != 'default_layout' && $layout_meta != '' ) { $layout = $layout_meta; } } return $layout; } endif; /****************************************************************************************/ add_filter( 'body_class', 'bikaro_body_class' ); /** * Filter the body_class * * Throwing different body class for the different layouts in the body tag */ function bikaro_body_class( $classes ) { global $post; if( $post ) { $layout_meta = get_post_meta( $post->ID, 'bikaro_page_layout', true ); } if( is_home() ) { $queried_id = get_option( 'page_for_posts' ); $layout_meta = get_post_meta( $queried_id, 'bikaro_page_layout', true ); } if( empty( $layout_meta ) || is_archive() || is_search() ) { $layout_meta = 'default_layout'; } $bikaro_default_layout = get_theme_mod( 'bikaro_default_layout', 'both_sidebar' ); $bikaro_default_page_layout = get_theme_mod( 'bikaro_pages_default_layout', 'both_sidebar' ); $bikaro_default_post_layout = get_theme_mod( 'bikaro_single_posts_default_layout', 'both_sidebar' ); if( $layout_meta == 'default_layout' ) { if( is_page() ) { $classes[] = $bikaro_default_page_layout; } elseif( is_single() ) { $classes[] = $bikaro_default_post_layout; } else { $classes[] = $bikaro_default_layout; } } else { $classes[] = $layout_meta; } if ( is_home() || is_archive() ) { if ( get_theme_mod( 'bikaro_archive_display_type', 'blog_medium' ) == 'blog_medium_alternate' ) { $classes[] = 'blog-alternate-medium'; } if ( get_theme_mod( 'bikaro_archive_display_type', 'blog_medium' ) == 'blog_medium' ) { $classes[] = 'blog-medium'; } } if( get_theme_mod( 'bikaro_site_layout', 'wide_layout' ) == 'wide_layout' ) { $classes[] = 'wide'; } elseif( get_theme_mod( 'bikaro_site_layout', 'wide_layout' ) == 'boxed_layout' ) { $classes[] = 'boxed'; } else { $classes[] = ''; } return $classes; } /****************************************************************************************/ add_action('wp_head', 'bikaro_custom_css'); /** * Hooks the Custom Internal CSS to head section */ function bikaro_custom_css() { $primary_color = get_theme_mod( 'bikaro_primary_color', '#4cb0c6' ); $bikaro_internal_css = ''; if( $primary_color != '#4cb0c6' ) { $bikaro_internal_css = ' #controllers a.active,#controllers a:hover,.comments-area .comment-author-link span,.bikaro-button,.fa.header-widget-controller,.pagination span,.post .entry-meta .read-more-link,.social-links i.fa:hover,a#scroll-up,button,input[type=reset],input[type=button],input[type=submit]{background-color:'.$primary_color.'}#content .comments-area a.comment-edit-link:hover,#content .comments-area a.comment-permalink:hover,#content .comments-area article header cite a:hover,#controllers a.active,#controllers a:hover,#featured-wide-slider .slider-title-head .entry-title a:hover,#site-title a:hover,#wp-calendar #today,.comment .comment-reply-link:hover,.comments-area .comment-author-link a:hover,.footer-widgets-area a:hover,.main-navigation a:hover,.main-navigation li.menu-item-has-children:hover>a:after,.main-navigation ul li ul li a:hover,.main-navigation ul li ul li:hover>a,.main-navigation ul li.current-menu-ancestor a,.main-navigation ul li.current-menu-item a,.main-navigation ul li.current-menu-item a:after,.main-navigation ul li.current-menu-item ul li a:hover,.main-navigation ul li.current_page_ancestor a,.main-navigation ul li.current_page_item a,.main-navigation ul li:hover>a,.more-link,.nav-next a:hover,.nav-previous a:hover,.next a:hover,.page .entry-title a:hover,.pagination a span:hover,.post .entry-meta a:hover,.post .entry-title a:hover,.previous a:hover,.read-more,.services-page-title a:hover,.single #content .tags a:hover,.slide-next i,.slide-prev i,.social-links i.fa,.type-page .entry-meta a:hover,a{color:'.$primary_color.'}blockquote{border-left:3px solid '.$primary_color.'}#header-text-nav-container{border-top:2px solid '.$primary_color.'}.social-links i.fa{border:1px solid '.$primary_color.'}#featured-wide-slider .slider-read-more-button a.slider-first-button,#featured-wide-slider .slider-read-more-button a.slider-second-button:hover{border:2px solid '.$primary_color.';background-color:'.$primary_color.'}a.slide-next,a.slide-prev{border:2px solid '.$primary_color.'}.breadcrumb a,.tg-one-fourth .widget-title a:hover,.tg-one-half .widget-title a:hover,.tg-one-third .widget-title a:hover{color:'.$primary_color.'}.pagination a span:hover{border-color:'.$primary_color.'}.header-widgets-wrapper,.widget-title span{border-bottom:2px solid '.$primary_color.'}'; } if( !empty( $bikaro_internal_css ) ) { ?> post_parent ) : get_adjacent_post( false, '', true ); $next = get_adjacent_post( false, '', false ); if ( ! $next && ! $previous ) return; } // Don't print empty markup in archives if there's only one page. if ( $wp_query->max_num_pages < 2 && ( is_home() || is_archive() || is_search() ) ) return; $nav_class = ( is_single() ) ? 'post-navigation' : 'paging-navigation'; ?> comment_type ) : case 'pingback' : case 'trackback' : // Display trackbacks differently than normal comments. ?>
  • id="comment-">

    ', '' ); ?>

  • id="li-comment-">
    %1$s%2$s', get_comment_author_link(), // If current post author is also comment author, make it known visually. ( $comment->user_id === $post->post_author ) ? '' . __( 'Post author', 'bikaro' ) . '' : '' ); printf( '
    %1$s
    ', sprintf( __( '%1$s at %2$s', 'bikaro' ), get_comment_date(), get_comment_time() ) ); printf( __( 'Permalink', 'bikaro'), esc_url( get_comment_link( $comment->comment_ID ) ) ); edit_comment_link(); ?>
    comment_approved ) : ?>

    __( 'Reply', 'bikaro' ), 'after' => '', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
    ' . get_bloginfo( 'name', 'display' ) . ''; $wp_link = '' . __( 'WordPress', 'bikaro' ) . ''; $tg_link = ''.__( 'themepuls', 'bikaro') .''; $default_footer_value = sprintf( __( 'Copyright © %1$s %2$s. All rights reserved.', 'bikaro' ), date( 'Y' ), $site_link ).'
    '.sprintf( __( 'Powered by %s.', 'bikaro' ), $wp_link ).' '.sprintf( __( 'Theme: %1$s by %2$s.', 'bikaro' ), 'bikaro', $tg_link ); $bikaro_footer_copyright = ''; echo $bikaro_footer_copyright; } endif; /**************************************************************************************/ if ( ! function_exists( 'bikaro_posts_listing_display_type_select' ) ) : /** * Function to select the posts listing display type */ function bikaro_posts_listing_display_type_select() { if ( is_home() || is_archive() ) { if ( get_theme_mod( 'bikaro_archive_display_type', 'blog_medium' ) == 'blog_large' ) { $format = 'blog-image-large'; } elseif ( get_theme_mod( 'bikaro_archive_display_type', 'blog_medium' ) == 'blog_medium' || get_theme_mod( 'bikaro_archive_display_type', 'blog_large' ) == 'blog_medium_alternate' ) { $format = 'blog-image-medium'; } elseif ( get_theme_mod( 'bikaro_archive_display_type', 'blog_medium' ) == 'blog_full_content' ) { $format = 'blog-full-content'; } } elseif ( is_front_page() && !is_home() ) { $format = 'page'; } else { $format = get_post_format(); } return $format; } endif; /****************************************************************************************/ /* * Creating Social Menu */ if ( ! function_exists( 'bikaro_social_menu' ) ) { function bikaro_social_menu() { if ( has_nav_menu( 'social' ) ) { wp_nav_menu( array( 'theme_location' => 'social', 'container' => 'div', 'container_id' => 'menu-social', 'container_class' => 'bikaro-social-menu', 'depth' => 1, 'fallback_cb' => false, 'items_wrap' => '', 'link_before' => '', 'link_after' => '' ) ); } } } /****************************************************************************************/ /* * Display the related posts */ if ( ! function_exists( 'bikaro_related_posts_function' ) ) { function bikaro_related_posts_function() { global $post; // Define shared post arguments $args = array( 'no_found_rows' => true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'ignore_sticky_posts' => 1, 'orderby' => 'rand', 'post__not_in' => array($post->ID), 'posts_per_page' => 3 ); // Related by categories if ( get_theme_mod('bikaro_related_posts', 'categories') == 'categories' ) { $cats = get_post_meta($post->ID, 'related-posts', true); if ( !$cats ) { $cats = wp_get_post_categories($post->ID, array('fields'=>'ids')); $args['category__in'] = $cats; } else { $args['cat'] = $cats; } } // Related by tags if ( get_theme_mod('bikaro_related_posts', 'categories') == 'tags' ) { $tags = get_post_meta($post->ID, 'related-posts', true); if ( !$tags ) { $tags = wp_get_post_tags($post->ID, array('fields'=>'ids')); $args['tag__in'] = $tags; } else { $args['tag_slug__in'] = explode(',', $tags); } if ( !$tags ) { $break = true; } } $query = !isset($break)?new WP_Query($args):new WP_Query; return $query; } } /****************************************************************************************/ /* * Creating responsive video for posts/pages */ if ( !function_exists('bikaro_responsive_video') ) : function bikaro_responsive_video( $html, $url, $attr, $post_ID ) { return '
    '.$html.'
    '; } add_filter( 'embed_oembed_html', 'bikaro_responsive_video', 10, 4 ) ; endif; /****************************************************************************************/ /* * Function to call the meta left side of the posts */ if ( !function_exists('bikaro_beside_entry_meta') ) : function bikaro_beside_entry_meta() { ?>
    %2$s'; 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() ) ); printf( __( '%3$s', 'bikaro' ), esc_url( get_permalink() ), esc_attr( get_the_time() ), $time_string ); ?>  '.__( 'Edit', 'bikaro' ), '', '' ); ?>
    ' . $title . ''; } return $content; } /****************************************************************************************/ /* * Function to call the meta of the posts */ if ( !function_exists('bikaro_entry_meta') ) : function bikaro_entry_meta() { if ( 'post' == get_post_type() ) : ?>