Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //wp-bootstrap-navwalker
- https://github.com/twittem/wp-bootstrap-navwalker
- // reset when multiple loop needed
- <?php rewind_posts(); ?>
- // conditional call back sidebar
- <?php if ( ! dynamic_sidebar( 'sibebar-name' ) ): ?>
- // conditional page query
- <?php if ( have_post() ) : while ( have_post() ) : the_post(); ?>
- <!-- page title -->
- <div class="page-header">
- <h1><?php the_title();?></h1>
- </div>
- <?php the_content();?>
- <!-- conditiona -->
- <?php endwhile; else: ?>
- <div class="page-header">
- <h1>Opps!</h1>
- </div>
- <p>No content is appearing for this page!</p>
- <?php endif;?>
- <!-- add style -->
- <?php
- function theme_styles(){
- wp_enqueue_style( 'name_of_file', get_template_directory_uri(). 'css/bootstrap.css' );
- wp_enqueue_style( 'another_name_of_file', get_template_directory_uri(). 'css/style.css' );
- }
- add_action('wp_enqueue_script','theme_styles');
- ?>
- <!-- conditional js for older IE -->
- <!-- load js properly -->
- <?php
- function theme_js(){
- global $wp_scripts;
- wp_register_script('html5_shivshiv','https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js','','',false);
- wp_register_script('respond_js','https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js','','',false);
- $wp_scripts->add_data( 'html5_shivshiv', 'conditional', 'lt IE 9' );
- $wp_scripts->add_data( 'respond_js', 'conditional', 'lt IE 9' );
- wp_enqueue_script('bootstrap_js',get_template_directory_uri().'js/bootstrap.js',array('jquery'),'',true);
- }
- add_action('wp_enqueue_script','theme_js');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement