ThemeShaper Forums » Thematic

[closed]

adding search to menu with functions, and css

(2 posts)
  • Started 9 years ago by killtheliterate
  • Latest reply from killtheliterate
  • This topic is not resolved
  1. dang ol', posting quite a bit today...

    i've followed tips on this forum to add a search field to the main nav menu. i was satisfied with it until i noticed that, for whatever reason, the vertical alignment of the search was different from browser to browser...

    after looking at themeshaper.com, i noticed that the search and menu items are being pulled in the same div. might be why it's easier to maintain the style between the two...

    the function i'm using right now follows

    // Remove default Thematic actions
    function remove_thematic_actions() {
        remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');
    
    // Create a custom access div with the menu and search box
    function search_access() { ?>
    
    <div id="access">
      <div class="skip-link"><a href="#content">">
        <?php _e('Skip to content', 'thematic'); ?>
        </a></div>
      <?php wp_page_menu('exclude=15,13,27,33&menu_class=menu menu-primary&sort_column=menu_order') ?>
      <div id="access-search">
        <form id="searchform" method="get" action="<?php bloginfo('home') ?>">
          <div>
            <input id="s" name="s" type="text" size="30" tabindex="1" onblur="if (this.value == '') {this.value = 'To search, type and hit enter';}" onfocus="if (this.value == 'To search, type and hit enter') {this.value = '';}" value="To search, type and hit enter"/>
            <input id="searchsubmit" name="searchsubmit" type="submit" value="<?php _e('Search', 'thematic') ?>" tabindex="2" />
          </div>
        </form>
      </div>
    </div>
    <!-- #access -->
    <?php }
    add_action('thematic_header','search_access',9);

    that's all pretty messy... i was hoping i could use something more like this

    // Remove the default Thematic Access
    function remove_thematic_actions() {
    	remove_action('thematic_header','thematic_access',9);
    }
    add_action('init','remove_thematic_actions');
    // Recreate the Thematic Access with menu-primary and menu-secondary
    function childtheme_page_menu() { ?>
    
    <div id="access">
      <?php wp_page_menu('exclude=15,13,27,33&menu_class=menu-primary'); ?>
    </div>
    <!– #access –>
    <?php }
          add_action('thematic_header','childtheme_page_menu','9');
    
    //searchform
    function add_search(){
    include (TEMPLATEPATH . '/searchform.php');
    }
    add_action('thematic_header','add_search');

    if i could get that function flowing right, then i could make sure that it's all on the same baseline, and float the menu ul left and the search right, instead of using position="absolute" and stuff like that

    i suppose i wouldn't mind the first function if i could get the css to work proper... don't know why, but i've spent hours trying all sorts of things, removing borders, messing with padding, seeing what the search form was pulling from the reset...

    http://mymedmarijuana.thedrearlight.com

    anyone have some tips?

    Posted 9 years ago #
  2. come on doods :)

    Posted 9 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.