esc_html__( 'Header menu', 'blog-karo' ), 'FooterMenuLocation' => esc_html('Footer Menu','blog-karo'), ) ); add_theme_support('title-tag'); /** * Add support for core custom logo. * * @link https://codex.wordpress.org/Theme_Logo */ add_theme_support( 'custom-logo', array( 'header-text' => array( 'site-title', 'site-description' ), 'flex-width' => true, 'flex-height' => true, ) ); add_theme_support( 'post-thumbnails' ); add_theme_support('automatic-feed-links'); /* * Switch default core markup for search form, comment form, and comments * to output valid HTML5. */ add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption', ) ); add_theme_support( "wp-block-styles" ); add_theme_support( "responsive-embeds" ); add_theme_support( 'align-wide' ); // Add theme support for selective refresh for widgets. add_theme_support( 'customize-selective-refresh-widgets' ); add_theme_support( "responsive-embeds" ); /* Add editor style. */ add_theme_support( 'editor-styles' ); add_theme_support( 'dark-editor-style' ); /* * This theme styles the visual editor to resemble the theme style, * specifically font, colors, icons, and column width. */ add_editor_style('/assets/css/editor-style.css'); /* Load editor style. */ add_editor_style(); add_theme_support( 'custom-background' ); } add_action('after_setup_theme','blogkaro_features'); /** * Defining theme version. */ define( 'WP_SIMPLE_BLOG_VERSION', '1.0.0' ); //Adding Breadcrumbs function get_breadcrumb() { echo 'Home'; if (is_category() || is_single()) { echo "  »  "; the_category(' • '); if (is_single()) { echo "   »   "; the_title(); } } elseif (is_page()) { echo "  »  "; echo the_title(); } elseif (is_search()) { echo "  »  Search Results for... "; echo '"'; echo the_search_query(); echo '"'; } } // Estimated Reading Time for Posts function vpsb_estimated_reading_time( $content = '') { $wpm = 200; // Word Per Minute (200 Average) $text_content = strip_shortcodes( $content ); // Remove Shortcodes $str_content = strip_tags( $text_content ); // Remove Tags $word_count = str_word_count( $str_content ); $readtime = ceil( $word_count / $wpm ); if ($readtime == 1) { $postfix = " minute"; } else { $postfix = " minutes"; } $readingtime = $readtime . $postfix; return $readingtime; } add_filter( "term_links-post_tag", 'add_tag_class'); function add_tag_class($links) { return str_replace('WordPress & Created by Gourav bagora'; } add_action('creator_theme','creator_theme'); function getPostViews($postID){ $count_key = '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 View"; } return $count.' Views'; } function setPostViews($postID) { $count_key = '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); } } // Add to a column in WP-Admin add_filter('manage_posts_columns', 'posts_column_views'); add_action('manage_posts_custom_column', 'posts_custom_column_views',5,2); function posts_column_views($defaults){ $defaults['post_views'] = __('Views', 'blog-karo'); return $defaults; } function posts_custom_column_views($column_name, $id){ if($column_name === 'post_views'){ echo getPostViews(get_the_ID()); } } function blogkaro_setup_theme_supported_features() { add_theme_support( 'editor-color-palette', array( array( 'name' => __( 'strong magenta', 'blog-karo' ), 'slug' => 'strong-magenta', 'color' => '#a156b4', ), array( 'name' => __( 'light grayish magenta', 'blog-karo' ), 'slug' => 'light-grayish-magenta', 'color' => '#d0a5db', ), array( 'name' => __( 'very light gray', 'blog-karo' ), 'slug' => 'very-light-gray', 'color' => '#eee', ), array( 'name' => __( 'very dark gray', 'blog-karo' ), 'slug' => 'very-dark-gray', 'color' => '#444', ), ) ); } add_action( 'after_setup_theme', 'blogkaro_setup_theme_supported_features' ); ?>