tag in the document head, and expect WordPress to * provide it for us. */ add_theme_support( 'title-tag' ); // This theme uses wp_nav_menu() in two locations. register_nav_menus ( array( 'primary' => __('Primary Menu', 'blogan'), ) ); /* * Enable support for Post Thumbnails on posts and pages. * * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails */ add_theme_support('post-thumbnails'); set_post_thumbnail_size( 370, 297, true ); /** * Add image size use otf_regen_thumbs.php */ add_image_size( 'blogan_thumbnail', 400, 400, true ); //featured // Add default posts and comments RSS feed links to head. add_theme_support( 'automatic-feed-links' ); /* * Enable support for Post Formats. * * See: https://codex.wordpress.org/Post_Formats */ add_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link', 'gallery', 'status', 'audio', 'chat', ) ); /* * 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' ); } endif; /** * Content width */ function blogan_content_width() { $GLOBALS['content_width'] = apply_filters( 'blogan_content_width', 900 ); } add_action( 'after_setup_theme', 'blogan_content_width', 0 ); /** * Enqueue scripts and styles * * @since blogan 1.0 */ add_action( 'wp_enqueue_scripts', 'blogan_stylesheet' ); function blogan_stylesheet() { // Google Font wp_enqueue_style( 'blogan-google-fonts', '//fonts.googleapis.com/css?family=Raleway:700|Open+Sans:400,700', false ); // Bootstrap Stylesheet wp_enqueue_style( 'blogan-bootstrap', get_template_directory_uri() . '/assets/css/bootstrap.min.css', array(), false, 'all' ); // Font Awesome wp_enqueue_style( 'blogan-font-awesome', get_template_directory_uri() . '/assets/css/font-awesome.min.css' ); // Theme Stylesheet wp_enqueue_style( 'blogan-style', get_stylesheet_uri() ); } add_action( 'wp_enqueue_scripts', 'blogan_js'); function blogan_js() { // Bootstrap js wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/assets/js/bootstrap.min.js', array('jquery'), false, true ); // Dropdown js wp_enqueue_script( 'dropdown', get_template_directory_uri() . '/assets/js/dropdown.js', array(), false, true); } /** * Excerpt Filter setting */ function blogan_excerpt_length($len) { return 20; } add_filter( 'excerpt_length', 'blogan_excerpt_length'); function blogan_excerpt_readmore($more) { global $post; return sprintf( '', get_permalink( get_the_ID() ), esc_url( get_template_directory_uri() . '/assets/img/readmore.png' ) ); } add_filter( 'excerpt_more', 'blogan_excerpt_readmore'); if ( ! function_exists( 'blogan_post_format' ) ) : /** * Blogan post format */ function blogan_post_format() { if ( ! get_post_format() ) { echo ''; } } endif; if ( ! function_exists( 'blogan_author' ) ) : /** * Blogan Author by */ function blogan_author() { printf( '', esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ), esc_attr( sprintf( __( 'View all posts by %s', 'blogan' ), get_the_author() ) ), get_the_author() ); } endif; /** * blogan Time Ago */ if ( ! function_exists( 'blogan_time_ago' ) ) : function blogan_time_ago( $type = 'post' ) { printf( '%s ' . __('ago', 'blogan') . '', human_time_diff( get_the_time( 'U' ), current_time( 'timestamp' ) ) ); } endif; if ( ! function_exists( 'blogan_category' ) ) : /** * Blogan Category Post */ function blogan_category() { global $post; $category_list = get_the_category_list( ' ' ); if ($category_list) { printf( '%1s', $category_list ); } } endif; if ( ! function_exists( 'blogan_tag' ) ) : /** * Blogan tag Post */ function blogan_tag() { global $post; $tags = wp_get_post_tags($post->ID); $html = '
'; foreach ( $tags as $tag ) { $tag_link = get_tag_link( $tag->term_id ); $html .= ""; $html .= "#{$tag->name} "; } $html .= '
'; echo $html; } endif; /** * blogan Call All Meta * Call Meta Together. */ add_action('do_blogan_show_meta', 'blogan_show_meta'); if ( ! function_exists( 'blogan_show_meta' ) ) : function blogan_show_meta() { ?> ID ), 'full' ); $twitterURL = 'https://twitter.com/intent/tweet?text='.$bloganTitle.'&url='.$bloganURL.'&via='; $facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.$bloganURL; $googleURL = 'https://plus.google.com/share?url='.$bloganURL; $pinterestURL = 'https://pinterest.com/pin/create/button/?url='.$bloganURL.'&media='.$bloganThumbnail[0].'&description='.$bloganTitle; ?>
'; echo '
  • '; if (is_single()) { echo '
  • '; the_category(', '); echo '
  • '; if (is_single()) { echo '
  • '; the_title(); echo '
  • '; } } elseif (is_category()) { echo '
  • '; single_cat_title(); echo '
  • '; } elseif (is_page() && (!is_front_page())) { echo '
  • '; the_title(); echo '
  • '; } elseif (is_tag()) { echo '
  • Tag: '; single_tag_title(); echo '
  • '; } elseif (is_day()) { echo'
  • Archive for '; get_the_date('F jS, Y'); echo'
  • '; } elseif (is_month()) { echo'
  • Archive for '; get_the_date('F, Y'); echo'
  • '; } elseif (is_year()) { echo'
  • Archive for '; get_the_date('Y'); echo'
  • '; } elseif (is_author()) { echo'
  • Author Archives'; echo'
  • '; } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { echo '
  • Blog Archives'; echo'
  • '; } elseif (is_search()) { echo'
  • Search Results'; echo'
  • '; } echo ''; } } endif; /** * Include Bootstrap Navwalker */ require_once( trailingslashit( get_template_directory() ) . 'inc/wp_bootstrap_navwalker.php' ); /** * Add Menu Navigation */ add_action( 'do_blogan_primary_menu', 'blogan_primary_menu' ); if ( ! function_exists( 'blogan_primary_menu' ) ) { function blogan_primary_menu() { wp_nav_menu( array( 'menu' => 'primary', 'theme_location' => 'primary', 'depth' => 3, 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker()) ); } } /** * Regiter widget Area */ add_action( 'widgets_init', 'blogan_widgets_init' ); function blogan_widgets_init() { register_sidebar(array( 'name' => __( 'Right Sidebar', 'blogan'), 'id' => 'blogan-sidebarright', 'description' => __('Add widgets here to appear in your sidebar', 'blogan'), 'before_title' => '

    ', 'after_title' => '

    ', 'before_widget' => '', )); } /** * Register custom widget */ require_once( trailingslashit( get_template_directory() ) . 'inc/widget/about-me.php' ); /** * Blogan function Logo */ add_action('do_logo', 'blogan_logo'); function blogan_logo() { if ( ! ( is_404() ) && ( is_single() ) || ( is_page() ) ) : ?>

    request; $posts_per_page = intval(get_query_var('posts_per_page')); $paged = intval(get_query_var('paged')); $numposts = $wp_query->found_posts; $max_page = $wp_query->max_num_pages; if ( $numposts <= $posts_per_page ) { return; } if(empty($paged) || $paged == 0) { $paged = 1; } $pages_to_show = 7; $pages_to_show_minus_1 = $pages_to_show-1; $half_page_start = floor($pages_to_show_minus_1/2); $half_page_end = ceil($pages_to_show_minus_1/2); $start_page = $paged - $half_page_start; if($start_page <= 0) { $start_page = 1; } $end_page = $paged + $half_page_end; if(($end_page - $start_page) != $pages_to_show_minus_1) { $end_page = $start_page + $pages_to_show_minus_1; } if($end_page > $max_page) { $start_page = $max_page - $pages_to_show_minus_1; $end_page = $max_page; } if($start_page <= 0) { $start_page = 1; } echo $before.''.$after.""; } } /** * Credit */ add_action('do_blogan_credit', 'blogan_credit'); function blogan_credit() { $url1 = '//rumblethemes.com'; $url2 = '//wordpress.org'; printf( __('Powered By ', 'blogan') . 'Wordpress. ' . __('Designed By ', 'blogan') . 'Rumble Themes' , esc_url($url2), esc_url($url1) ); } // Tags content filter function blogan_after_content_tag($content){ if (is_single()) { $content .= '
    '; $content .= get_the_tag_list( sprintf( '

    %s ', __( 'Tags:', 'blogan' ) ), ', ', '

    ' ); $content .= '
    '; } return $content; } add_filter( 'the_content', 'blogan_after_content_tag');