コード例 #1
0
function demoshop_navbar()
{
    ?>
<div class="navbar navbar-default" role="navigation">
  <div class="navbar-header">

    <!-- .navbar-toggle is used as the toggle for collapsed navbar content -->
    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
      <span class="icon-bar"></span>
    </button>
   </div>
   
    <br><br>
    <!-- Place everything within .navbar-collapse to hide it until above 768px -->
    <div class="collapse navbar-collapse navbar-responsive-collapse">
            
				<?php 
    jbst_main_nav('sf-menu sf-vertical sf-js-enabled');
    // Adjust using Menus in Wordpress Admin
    ?>
				
    </div><!-- /.nav-collapse -->
  
</div><!-- /.navbar -->

<?php 
}
コード例 #2
0
function jbst_main_navbar()
{
    ?>
<header role="banner"><?php 
    /**
     * Optional HTML5 inside the <header> before content.
     *
     * Optional HTML5 inside the <header> add before the main content (logo and navbar).
     * 
     *  Example:
     * 
     * function test_beforeheader($content)
     * {
     * return get_template_part( 'content', 'beforeheader');
     * }	
     * add_filter('jbst_before_headercontent','test_beforeheader');
     * 
     *
     * @since 2.0.6
     *
     * @param string $content empty HTML5 string.
     */
    echo apply_filters('jbst_before_headercontent', '');
    $fixed = preg_match('/fixed/', get_theme_mod('navbar_style', navbar_style));
    if (get_theme_mod('logo_image_position', logo_image_position) == 'outside-nav' && !$fixed) {
        echo apply_filters('jbst_logooustside', jbst_logooustside());
    }
    if (get_theme_mod('navbar_style', navbar_style) == 'default') {
        ?>
<div class="container"><?php 
    }
    ?>
	
	<nav role="navigation" class="navbar navbar-default <?php 
    echo get_theme_mod('navbar_style', navbar_style);
    ?>
 <?php 
    //echo get_theme_mod( 'navbar_color', 'navbar-default' );
    ?>
" id="jbst-top-nav">

       <div class="container-fluid">
       <a class="sr-only" href="#content"><?php 
    _e('Skip to content', 'jamedo-bootstrap-start-theme');
    ?>
</a>

       <div class="navbar-header">
		<!-- .navbar-toggle is used as the toggle for collapsed navbar content -->
		<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
		  <span class="sr-only"><?php 
    echo __('Toggle navigation', 'jamedo-bootstrap-start-theme');
    ?>
</span>
		  <span class="icon-bar"></span>
		  <span class="icon-bar"></span>
		  <span class="icon-bar"></span>
		</button>
			<?php 
    if (get_theme_mod('logo_image_position', logo_image_position) == 'in-nav') {
        echo apply_filters('jbst_logo', jbst_logo());
    }
    ?>
       </div>
         
		  
         <!-- Collect the nav links, forms, and other content for toggling -->
          <div class="collapse navbar-collapse navbar-ex1-collapse">
		  <?php 
    do_action('jbst_navbar_left');
    ?>
		  <?php 
    jbst_main_nav();
    // Adjust using Menus in Wordpress Admin
    ?>
		  <?php 
    if (get_theme_mod('navbar_search', navbar_search) == 1) {
        jbst_nav_search();
    }
    ?>
 
		  <!--ul class="nav navbar-nav navbar-right"-->
		  <?php 
    if (get_theme_mod('navbar_cart', navbar_cart) == 1) {
        jbst_cart_dropdown();
    }
    ?>
		  <?php 
    if (get_theme_mod('navbar_account', navbar_account) == 1) {
        jbst_account_dropdown();
    }
    ?>
		  <?php 
    do_action('jbst_navbar_right');
    ?>
          <!--/ul-->
          </div>
        
       <?php 
    if (get_theme_mod('navbar_style', navbar_style) != 'default') {
        ?>
</div><?php 
    }
    ?>
    </nav>
    <?php 
    if (get_theme_mod('navbar_style', navbar_style) == 'default') {
        ?>
</div><?php 
    }
    ?>
	<?php 
    if (get_theme_mod('logo_image_position', 'in-nav') == 'outside-nav' && $fixed) {
        echo apply_filters('jbst_logooustside', jbst_logooustside());
    }
    /**
     * Optional HTML5 inside the <header> after content.
     *
     * Optional HTML5 inside the <header> add after the main content (logo and navbar).
     * 
     *  Example:
     * 
     * function test_afterheader($content)
     * {
     * return get_template_part( 'content', 'beforeheader');
     * }	
     * add_filter('jbst_after_headercontent','test_afterheader');
     * 
     *
     * @since 2.0.6
     *
     * @param string $content empty HTML5 string.
     */
    echo apply_filters('jbst_after_headercontent', '');
    ?>
</header><?php 
}