__('Main Menu', 'blogr'), ) ); // Add support for a featured image and the size add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size(300,300, true); add_image_size( 'blogr_home', 500, 333, true ); add_image_size( 'blogr_featured', 832, 300, true ); add_image_size( 'blogr_single', 1600, 400, true ); // Adds RSS feed links to for posts and comments. add_theme_support( 'automatic-feed-links' ); // Set Content Width if ( ! isset( $content_width ) ) $content_width = 800; // Display a admin notices add_action('admin_notices', 'blogr_admin_notice'); function blogr_admin_notice() { global $current_user; $blogr_pro = 'http://themes4wp.com/product/blogr-pro/'; $user_id = $current_user->ID; /* Check that the user hasn't already clicked to ignore the message */ if ( ! get_user_meta($user_id, 'blogr_ignore_notice') ) { echo '
'; printf(__('Like BlogR theme? You will LOVE BlogR PRO!','blogr').' '.__('Click here for all the exciting features.','blogr').'', '?blogr_notice_ignore=0'); echo "
';
echo '';
}
}
endif;
////////////////////////////////////////////////////////////////////
// Enqueue Styles
////////////////////////////////////////////////////////////////////
function blogr_theme_stylesheets() {
wp_enqueue_style('blogr-bootstrap', get_template_directory_uri() . '/css/bootstrap.css', array(), '1', 'all' );
wp_enqueue_style( 'blogr-stylesheet', get_stylesheet_uri(), array(), '1', 'all' );
// load Font Awesome css
wp_enqueue_style( 'blogr-font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), false );
}
add_action('wp_enqueue_scripts', 'blogr_theme_stylesheets');
////////////////////////////////////////////////////////////////////
// Register Bootstrap JS with jquery
////////////////////////////////////////////////////////////////////
function blogr_theme_js() {
wp_enqueue_script('blogr-bootstrap-js', get_template_directory_uri() . '/js/bootstrap.js',array( 'jquery' ),true );
wp_enqueue_script('blogr-theme-js', get_template_directory_uri() . '/js/customscript.js',array( 'jquery' ),true );
}
add_action('wp_enqueue_scripts', 'blogr_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', 'blogr_widgets_init' );
function blogr_widgets_init() {
register_sidebar(
array(
'name' => __('Right Sidebar', 'blogr'),
'id' => 'right-sidebar',
'before_widget' => '',
'before_title' => '