thewirelessguy / cornerstone

Cornerstone is a WordPress starter theme based on the Zurb Foundation Responsive Framework. Cornerstone aims to provide a lightweight starter theme that is responsive and SEO friendly that web designers can build great looking websites on.
GNU General Public License v2.0
155 stars 40 forks source link

Feature Wish - Searchform in top-bar #8

Closed DesignMitZweiS closed 4 years ago

DesignMitZweiS commented 11 years ago

Yep, that would be a bomb. I've tried it myself but I have to admit I only understand your code partial ;)

It's a nice to have, so it's not very urgent to me. In case of you don't like my idea, maybe you could give me a hint how or where to include the

get_search_form();

code.

valgalin commented 10 years ago

Hi @DesignMitZweiS , I was looking for the same solution. By testing around, I've discovered that you only have to add a new section class for the top bar and input the Foundation code for the search form.

Here's a sample code (see the first section class):

<nav class="top-bar" data-topbar>
  <ul class="title-area">
    <li class="name">
        <a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    </li>    
    <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
    <li class="toggle-topbar menu-icon"><a href="#"><span></span></a></li>        
  </ul>

  <section class="top-bar-section">
     <ul class="left">
      <li class="has-form">
        <div class="row collapse">
          <div class="large-8 small-9 columns">
            <input type="text" placeholder="Find Stuff">
          </div>
          <div class="large-4 small-3 columns">
           <a href="#" class="alert button expand">Search</a>
          </div>
        </div>
      </li>
      <li class="name">
        <a href="#" class="button">Button</a>
      </li>
    </ul>
  </section> 

  <section class="top-bar-section">
    <?php
      // Left Nav Section
      if ( has_nav_menu( 'header-menu-left' ) ) {
          wp_nav_menu( array(
              'theme_location' => 'header-menu-left',
              'container' => false,
              'depth' => 0,
              'items_wrap' => '<ul class="left">%3$s</ul>',
              'fallback_cb' => false,
              'walker' => new cornerstone_walker( array(
                  'in_top_bar' => true,
                  'item_type' => 'li'
              ) ),
          ) );
        }
      ?>

    <?php
      //Right Nav Section
      if ( has_nav_menu( 'header-menu-right' ) ) {
          wp_nav_menu( array(
              'theme_location' => 'header-menu-right',
              'container' => false,
              'depth' => 0,
              'items_wrap' => '<ul class="right">%3$s</ul>',
              'fallback_cb' => false,
              'walker' => new cornerstone_walker( array(
                  'in_top_bar' => true,
                  'item_type' => 'li'
              ) ),
          ) );
        }
      ?>
  </section>
</nav>