__('Main Menu', 'blogmaster'), ) ); // Add support for a featured image and the size add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size(300,300, true); add_image_size( 'blogmaster-home', 731, 441, true ); add_image_size( 'blogmaster-single', 1170, 450, true ); add_image_size( 'blogmaster-slider-nav', 234, 131, true ); // Adds RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); // Display a admin notices add_action('admin_notices', 'blogmaster_admin_notice'); function blogmaster_admin_notice() { global $current_user; $user_id = $current_user->ID; /* Check that the user hasn't already clicked to ignore the message */ if ( ! get_user_meta($user_id, 'blogmaster_ignore_notice') ) { echo '
'; printf(__('Like Blogmaster theme? You will LOVE Blogmaster PRO! ','blogmaster').''.__('Click here for all the exciting features.','blogmaster').'', '?blogmaster_notice_ignore=0'); echo "
';
echo '';
}
}
endif;
////////////////////////////////////////////////////////////////////
// Enqueue Styles (normal style.css and bootstrap.css)
////////////////////////////////////////////////////////////////////
function blogmaster_theme_stylesheets()
{
wp_enqueue_style('blogmaster-bootstra-css', get_template_directory_uri() . '/css/bootstrap.css', array(), '1', 'all' );
wp_enqueue_style( 'blogmaster-stylesheet', get_stylesheet_uri(), array(), '1', 'all' );
// load Font Awesome css
wp_enqueue_style('blogmaster-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', false );
// load Flexslider css
wp_enqueue_style('blogmaster-flexslider-css', get_template_directory_uri() . '/css/flexslider.css', 'style');
}
add_action('wp_enqueue_scripts', 'blogmaster_theme_stylesheets');
////////////////////////////////////////////////////////////////////
// Register Bootstrap JS with jquery
////////////////////////////////////////////////////////////////////
function blogmaster_theme_js()
{
wp_enqueue_script('blogmaster-bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js',array( 'jquery' ),array(),true );
wp_enqueue_script('blogmaster-theme-js', get_template_directory_uri() . '/js/customscript.js',array( 'jquery' ),array(),true );
wp_enqueue_script('blogmaster-flexslider-js', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'));
}
add_action('wp_enqueue_scripts', 'blogmaster_theme_js');
////////////////////////////////////////////////////////////////////
// Register Custom Navigation Walker include custom menu widget to use walkerclass
////////////////////////////////////////////////////////////////////
require_once('lib/wp_bootstrap_navwalker.php');
////////////////////////////////////////////////////////////////////
// Theme Info page
////////////////////////////////////////////////////////////////////
if (is_admin()) {
require_once(trailingslashit( get_template_directory() ) . '/lib/theme-info.php');
}
////////////////////////////////////////////////////////////////////
// Register the Sidebar(s)
////////////////////////////////////////////////////////////////////
add_action( 'widgets_init', 'blogmaster_widgets_init' );
function blogmaster_widgets_init() {
register_sidebar(
array(
'name' => __('Right Sidebar', 'blogmaster'),
'id' => 'blogmaster-right-sidebar',
'before_widget' => '',
'before_title' => '' . esc_attr($thiscomment) . '
'); endforeach; } else { echo ''. __( 'No comments', 'blogmaster') .'
'; } echo ''. __( 'Add your comment', 'blogmaster') .'
'; } function blogmaster_comments_count() { global $post; $args = array( 'post_id' => $post->ID, 'count' => true ); $comments = get_comments($args); echo $comments; } function blogmaster_cat_list() { global $post; $categories = get_the_category(); $separator = ', '; if($categories){ foreach($categories as $category) { echo '' . esc_attr($category->cat_name) . ''.$separator; } } } ?>