Created
January 27, 2017 20:54
-
-
Save cannelflow/8865fe28094f7b172ed1992a6e529cdc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Theme Support | |
function mywordstrap_theme_setup(){ | |
//post-thumbnail | |
add_theme_support('post-thumbnails'); | |
// Nav Menus | |
register_nav_menus(array( | |
'primary' => __('Primary Menu') | |
)); | |
// Post Formats | |
add_theme_support('post-formats', array('aside', 'gallery')); | |
} | |
add_action('after_setup_theme','mywordstrap_theme_setup'); | |
//add js & css | |
function mywordstrap_scripts() { | |
wp_enqueue_style( 'bootstrap-styles', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '3.3.7', 'all' ); | |
wp_enqueue_style( 'font-awesome', get_template_directory_uri() . '/css/font-awesome.min.css', array(), '4.7.0', 'all' ); | |
wp_enqueue_style( 'indiw-flower', 'https://fonts.googleapis.com/css?family=Indie+Flower', false ); | |
wp_enqueue_style( 'open-sans', 'https://fonts.googleapis.com/css?family=Alfa+Slab+One', false ); | |
wp_enqueue_style( 'site-css', get_template_directory_uri() . '/scss/style.css'); | |
wp_enqueue_script( 'bootstrap-js', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '3.3.7', true ); | |
wp_enqueue_script( 'custome-js', get_template_directory_uri() . '/js/main.js'); | |
// wp_enqueue_script( 'bootstrapwp-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true ); | |
if ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) { | |
wp_enqueue_script( 'comment-reply' ); | |
} | |
} | |
add_action( 'wp_enqueue_scripts', 'mywordstrap_scripts' ); | |
/** | |
* Add Respond.js for IE | |
*/ | |
if( !function_exists('ie_scripts')) { | |
function ie_scripts() { | |
echo '<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->'; | |
echo ' <!-- WARNING: Respond.js doesn\'t work if you view the page via file:// -->'; | |
echo ' <!--[if lt IE 9]>'; | |
echo ' <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>'; | |
echo ' <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>'; | |
echo ' <![endif]-->'; | |
} | |
add_action('wp_head', 'ie_scripts'); | |
} // end if | |
// Widget Locations | |
function mywordstrap_sidebar($id){ | |
register_sidebar(array( | |
'name' => __('sidebar', 'mywordstrap'), | |
'id' => 'sidebar', | |
'description' => __( 'Sidebar for the theme mywordstrap', 'mywordstrap' ), | |
'class' => '', | |
'before_widget' => '<div id="%1$s" class="sidebar-module %2$s">', | |
'after_widget' => '</div></div></div>', | |
'before_title' => '<div class="sidebar-header bg-primary"><span class="sidebar-title">', | |
'after_title' => '</span></div><div class="sidebar-content"><div class="widget">' | |
)); | |
} | |
add_action('widgets_init', 'mywordstrap_sidebar'); | |
// Register Custom Navigation Walker | |
require_once('wp_bootstrap_navwalker.php'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment