esc_html__( 'Primary Menu', 'belinni-lite' ), ) ); // Localization load_theme_textdomain('belinni-lite', get_template_directory() . '/languages'); // Post formats add_theme_support( 'post-formats', array( 'gallery', 'video', 'audio', 'quote' ) ); // Featured image add_theme_support( 'post-thumbnails' ); add_image_size( 'belinni-big-slider', 1140, 540, true ); add_image_size( 'belinni-full-post', 780, 450, true ); add_image_size( 'belinni-middle-size', 640, 430, true ); add_image_size( 'belinni-masonry-size', 550); add_image_size( 'belinni-post-grid', 420, 320, true ); add_image_size( 'belinni-latest-side', 80, 80, true ); // Feed Links add_theme_support( 'automatic-feed-links' ); // Page Title add_theme_support( 'title-tag' ); //Woocommerce support add_theme_support( 'woocommerce' ); } } function belinni_remove_script_version( $src ){ $parts = explode( '?ver', $src ); return $parts[0]; } add_filter( 'script_loader_src', 'belinni_remove_script_version', 15, 1 ); add_filter( 'style_loader_src', 'belinni_remove_script_version', 15, 1 ); /** * PostViews */ function pixelshow_getPostViews($postID){ $count_key = 'belinni_post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); return "0"; } return $count.''; } function pixelshow_setPostViews($postID) { $count_key = 'belinni_post_views_count'; $count = get_post_meta($postID, $count_key, true); if($count==''){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, '0'); }else{ $count++; update_post_meta($postID, $count_key, $count); } } remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); /** * Get theme mod */ if( !function_exists( 'pixelshow_get_theme_mod' ) ) { function pixelshow_get_theme_mod( $key, $default ) { return get_theme_mod( $key, $default ); } } /** * Fonts url */ if( !function_exists( 'pixelshow_belinni_fonts_url' ) ){ function pixelshow_belinni_fonts_url() { $fonts_url = ''; $fonts = array(); $subsets = 'latin'; $body_font = pixelshow_get_fonts( pixelshow_get_theme_mod( 'pixelshow_pxs_body_font_family', 'open_sans' ) ); $headings_font = pixelshow_get_fonts( pixelshow_get_theme_mod( 'pixelshow_pxs_heading_font_family', 'poppins' ) ); // Main font $fonts[ pixelshow_get_theme_mod( 'pixelshow_pxs_body_font_family', 'open_sans' ) ] = isset( $body_font['link'] ) ? $body_font['link'] : ''; // Heading font $fonts[ pixelshow_get_theme_mod( 'pixelshow_pxs_heading_font_family', 'poppins' ) ] = isset( $headings_font['link'] ) ? $headings_font['link'] : ''; if ( $fonts ) { $fonts_url = add_query_arg( array( 'family' => implode( '%7C', $fonts ), 'subset' => $subsets, ), 'https://fonts.googleapis.com/css' ); } return $fonts_url; } } /** * Register & enqueue styles/scripts */ add_action( 'wp_enqueue_scripts', 'pixelshow_load_scripts' ); function pixelshow_load_scripts() { // Register scripts and styles wp_enqueue_style( 'belinni-fonts', pixelshow_belinni_fonts_url(), array(), null ); wp_enqueue_style('font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), null); wp_enqueue_style('plugins-styles', get_template_directory_uri() . '/css/plugins-styles.css', array(), null); wp_enqueue_style('belinni-main-styles', get_template_directory_uri() . '/style.css', array(), null); wp_enqueue_style('responsive', get_template_directory_uri() . '/css/media.css', array(), null); wp_enqueue_script('plugins' ,get_template_directory_uri(). '/js/plugins.js', array('jquery'), '1.0.0', true); wp_enqueue_script('belinni-main-scripts', get_template_directory_uri(). '/js/main.js', array('jquery'), '1.0.0', true); if (is_singular() && get_option('thread_comments')) { wp_enqueue_script('comment-reply'); } } /** * Add title back to images */ function pixelshow_add_title_to_attachment( $markup, $id ){ $att = get_post( $id ); return str_replace(' esc_html__( 'Sidebar', 'belinni-lite' ), 'id' => 'sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => esc_html__( 'Glide Sidebar', 'belinni-lite' ), 'id' => 'glide_sidebar', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', )); register_sidebar(array( 'name' => esc_html__( 'Header Woocommerce Cart', 'belinni-lite' ), 'id' => 'header_woocommerce_cart', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', 'description' => esc_html__( 'IMPORTANT: This area is used for Woocommerce Cart Widget', 'belinni-lite' ), )); register_sidebar(array( 'name' => esc_html__( 'Instagram Footer', 'belinni-lite' ), 'id' => 'footer_insta', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__( 'Footer Left Side', 'belinni-lite' ), 'id' => 'footer_part_1', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__( 'Footer Center Block', 'belinni-lite' ), 'id' => 'footer_part_2', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__( 'Footer Right Side', 'belinni-lite' ), 'id' => 'footer_part_3', 'before_widget' => '', 'before_title' => '

', 'after_title' => '

' )); register_sidebar(array( 'name' => esc_html__( 'ADS Above Slider', 'belinni-lite' ), 'id' => 'prom_above_slider', 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', 'description' => esc_html__( 'IMPORTANT: This area is used for ADS Banners and Text Widget', 'belinni-lite' ), )); } /** * Comments */ function pixelshow_comments($pixelshow_comment, $args, $depth) { $GLOBALS['pixelshow_comment'] = $pixelshow_comment; ?>
id="comment-">
__('Reply', 'belinni-lite'), 'depth' => $depth, 'max_depth' => $args['max_depth'])), $pixelshow_comment->comment_ID); ?> comment_approved == '0') : ?>
cat_ID != $excluded_cat) { if ($first_time == 1) { echo '
name ) . '" ' . '>' . $category->name.''; $first_time = 0; } else { echo $separator . 'name ) . '" ' . '>' . $category->name.''; } } } } else { $first_time = 1; foreach((get_the_category()) as $category) { if ($first_time == 1) { echo 'name ) . '" ' . '>' . $category->name.''; $first_time = 0; } else { echo $separator . 'name ) . '" ' . '>' . $category->name.''; } } } } /** * Redefine the search form structure */ if ( ! function_exists( 'belinni_search_form' ) ) { function belinni_search_form( $form ) { $form = ' '; return $form; } } add_filter( 'get_search_form', 'belinni_search_form' ); /** * Except */ function pixelshow_custom_excerpt_length( $length ) { return 200; } add_filter( 'excerpt_length', 'pixelshow_custom_excerpt_length', 999 ); function pixelshow_string_limit_words($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if(count($words) > $word_limit) { array_pop($words); } return implode(' ', $words); } /** * Gif Support */ function disable_upload_sizes( $sizes, $metadata ) { $filetype = wp_check_filetype($metadata['file']); if($filetype['type'] == 'image/gif') { $sizes = array(); } return $sizes; } add_filter('intermediate_image_sizes_advanced', 'disable_upload_sizes', 10, 2); /** * Author socials */ function pixelshow_contactmethods( $contactmethods ) { $contactmethods['twitter'] = esc_html__( 'Twitter Username', 'belinni' ); $contactmethods['facebook'] = esc_html__( 'Facebook Username', 'belinni' ); $contactmethods['google'] = esc_html__( 'Google Plus Username', 'belinni' ); $contactmethods['tumblr'] = esc_html__( 'Tumblr Username', 'belinni' ); $contactmethods['instagram'] = esc_html__( 'Instagram Username', 'belinni' ); $contactmethods['pinterest'] = esc_html__( 'Pinterest Username', 'belinni' ); return $contactmethods; } add_filter('user_contactmethods','pixelshow_contactmethods'); // About Belinni require get_parent_theme_file_path( '/inc/about/about-belinni.php' );