• Resolved melanie bund

    (@melanie-bund)


    Hi
    Theme 2012 – I have been asking alot of questions on this forum but unluckily have had no feedback, managed to sort out most of the problems myself. I have 2 more problems
    i want to add a search field to my sidebar not widgeted menu. No way to do that in admin… as its a custom menu. Can somebody help?
    My second problem is that the main menu when seen on smaller screens such a ipad, or just narrow the browser window goes onto 2 lines, and looks pretty bad and with the drop downs a complete mess . is this a twentytwelve bug? and how do i fix? – PLEASE i have been posting for months and no one answers my questions!
    link below
    https://photohunters.org/photohunters
    Melanie

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m confused what you’re wanting to do. Are you just trying to add a search form to your sidebar? You should be able to do that just by adding the search widget. I’m not sure what that has to do with a menu, custom or otherwise.

    I also looked at your site with a small browser window and my iPhone and it changes to a mobile menu ok. I don’t see the problem you’re noting.

    Thread Starter melanie bund

    (@melanie-bund)

    Hi Matt thank you soooo much for answering.
    The twenty twelve menu is fine in iphone view as i realised the wp had changed the <h3> tag to <button> unfortunately had to upload a plugin to as i couldnt style the toggle menu – the problem with the menu is in anything larger – ipad landscape, or even a small monitor – the menu appears on 2 lines and i have no idea how to keep it on one line – shrink text on smaller screens? make the padding a % ?

    thnk you
    Melanie
    PS.
    My sidebar is not dynamic/widget side bar it is a custom menu so through admin i cant add a search field. But i found some code that works!
    ‘add_filter(‘wp_nav_menu_items’,’add_search_box_to_menu’, 10, 2);
    function add_search_box_to_menu( $items, $args ) {
    if( $args->theme_location == ‘sidebar-profile’ )
    return $items.get_search_form();

    return $items;
    }’

    As the screen width reduces, there seems to come a point at about 980px where the menu has to split into two lines to be able to fit the width available. What you could do is, at this point, reduce the right margin on the menu items from 40px to 12 px. This should suffice until the other menu kicks in at 768px width.

    Try this in your custom css:

    @media only screen and (max-width: 980px) {
      .main-navigation li {margin-right:12px}
    }

    Some trial end error with the values may be necessary.

    Its possible to reduce the margin in steps with a series of media queries, depending on your patience.

    Thread Starter melanie bund

    (@melanie-bund)

    Thank you loor – so much!!!
    Melanie

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘add search to sidebar menu that is not widget(ed)’ is closed to new replies.