Viewing 30 posts - 1 through 30 (of 31 total)
  • Author
    Posts
  • #1232257

    Hi, how can I add the search icon to the footer navigation instead of header?

    #1232380

    Hey amyteslin,

    Please have a look at the following thread:
    https://kriesi.at/support/topic/shortcode-or-function-to-add-search-in-custom-locations/#post-436832

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1235470

    Hi, it doesn’t achieve what I’m looking for. I want to have the icon that you can choose to have in the header, but I want it on my footer menu instead. Any ideas? Many thanks for your help.

    #1235547

    And to what direction the search-input field should open?
    Where does the ajax search results should toggle?
    What happend to the scroll to top button?

    This in child-theme functions.php will place the magnifier icon in the menu3 of enfold:

    function avia_append_search_nav3 ( $items, $args )
    {
        if ((is_object($args) && $args->theme_location == 'avia3') || (is_string($args) && $args = "fallback_menu"))
          {
              global $avia_config;
              ob_start();
              get_search_form();
              $form =  htmlspecialchars(ob_get_clean()) ;
    
              $items .= '<li id="menu-item-search3" class="noMobile menu-item menu-item-search-dropdown menu-item-avia-special">
                     <a href="?s=" data-avia-search-tooltip="'.$form.'" '.av_icon_string('search').'>
                      <span class="avia_hidden_link_text">'.__('Search','avia_framework').'</span>
                     </a>
                   </li>';
          }
          return $items;
    }
    add_filter( 'wp_nav_menu_items', 'avia_append_search_nav3', 10, 2 );

    but i do not know how to get the ajax search results to show

    #1235655

    Hi amyteslin,

    Did you try Guenni007’s suggestion above?

    Best regards,
    Victoria

    #1236431

    Hi there,

    I have added the code to functions but it hasn’t worked. I only have two menus, the main nav and the footer. I tried to create menu3 but it didn’t work.

    #1236437

    as far as i know
    1) the enfold main menu is always: .main_menu
    ( a class here because if you got menu below logo there will be an extra container ( #header_main_alternate) for that cloned menu)
    2) the top menu : #avia2-menu
    3) footer menu: #avia3-menu
    these are theme_locations not names of the menu.

    are you familiar with developer tools of your browser? Inspect the footer menu and see what ID this menu has got.

    but nevertheless – have you seen my concerns about the position?

    #1236439

    Hi, I see now thank you. Is it not possible to achieve then? If not as part of the footer, how can I add it next to the social icons on my footer? Or is it the same issues? http://amyteslinstaging-com.stackstaging.com/weddings/

    #1236440

    Or do you mean a navigation in the #footer ( not footer : #socket) – and you put a widget to one of your #footer columns by : navigation menu widget ???

    #1236441

    ok – we posted the same time.
    How did you create that footer? is it a page as footer ?

    #1236442

    I have just added the search option to the footer widget and it comes up s a bar but I would like it to be a search icon and not a bar.
    Hope that makes sense!

    #1236449

    Well a quick and dirty way would be to activate the main menu search icon ( Dashboard – Enfold Child – Main Menu: “Append search icon to main menu”)
    – and shift this to your other menu:

    function shift_search_icon(){
    ?>
    <script type="text/javascript">
    (function($){
    	$('#avia-menu').find('#menu-item-search').detach().appendTo('#menu-menu3');
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'shift_search_icon');
    #1236453

    Hi, it’s doing something strange. When I open the page, I can see the icon is part of the menu but then it disappears. I’m not sure what I’ve done?!

    • This reply was modified 4 years, 4 months ago by amyteslin.
    #1236458

    on my test page is stayes at the menu.
    can you try this:

    function shift_search_icon(){
    ?>
    <script type="text/javascript">
    (function($){
    	$('#avia-menu').find('#menu-item-search').clone().appendTo('#menu-menu3');
             $('#avia-menu').find('#menu-item-search').remove();
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'shift_search_icon');

    just to see if detach() is the problem

    #1236460

    Ok, I got that working, but it is glitchy when trying to search, can you see what I mean?

    #1236461

    Yes – it is the way you style your menu to have not the treestructure there but besides each other.

    Look how you reach it in your css and try to substitute it by:

    #footer .widget {
        padding: 0;
        margin: 30px 0 30px 0;
        overflow: visible;
    }
    
    #footer .widget_nav_menu ul {
        display: flex;
        flex-flow: row wrap;
        justify-content: center;
    }
    
    #footer .avia-search-tooltip {
        top: 100% !important;
        margin-left: -130px;
    }

    but i do not know why the ajax search proposals aren’t there – did you switch of that feature?

    #1236463
    #1236470

    Thanks so much! It’s so nearly there. However, you’re correct about the icon but I have tried the coding in the link and it hasn’t fixed it :/

    #1236478

    you have set an important rule to all buttons
    font-family : butler light

    so entypo-fontello is lost.

    try this :

    #top #footer #searchsubmit {
      background-color: #464f5a !important;
      font-family: entypo-fontello !important;
      line-height: 0 !important;
    }
    
    .avia-search-tooltip {
        top: 100% !important;
    }
    
    #footer .avia-arrow-wrap .avia-arrow {
    	background-color: #464f5a !important;
    }
    
    #searchform  #s {
      border : none !important;
    }
    #1236594

    Hi,

    Thanks for helping out @guenni007 :-)

    Best regards,
    Rikard

    #1236700

    It works! I really appreciate your help. Thanks so much!

    #1236888

    Hi amyteslin,

    Great, I’m glad that you got it working. Please let us know if you should need any further help on the topic or if we can close it.

    Thanks again to @guenni007 for helping out :-)

    Best regards,
    Rikard

    #1239795

    Hi again, do you think there is a way on mobile view to get the search to drop onto a new line underneath? Thanks so much.

    #1240419

    Hi amyteslin,

    Best regards,
    Victoria

    #1241307

    first i do not see the input when i click the magnifier symbol for wide screens – because you have in your css a rule:

    #top  #searchform {
        display: none !important;
    }

    and that hampers to show the input form !
    I know that you want to replace the search there for smaller screens but duplicate ID’s are not good html.

    to avoid duplicate IDs add to the code above: $('#menu-menu3').find('form').attr('ID', 'searchform-2');

    so that there is then:

    function shift_search_icon(){
    ?>
    <script type="text/javascript">
    (function($){
    	$('#avia-menu').find('#menu-item-search').clone().appendTo('#menu-menu3');
    	$('#menu-menu3').find('form').attr('ID', 'searchform-2');
        $('#avia-menu').find('#menu-item-search').remove();
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'shift_search_icon');

    you only had to set the css then for it to:

    #top #searchform-2 {
        margin: 0;
        padding: 0;
    }
    #1244665

    Hi guys, I have got it working now but ‘go to top’ button seems to have disappeared, do you know what’s happening? Thanks so much for your patients.

    • This reply was modified 4 years, 3 months ago by amyteslin.
    #1244809

    Hi amyteslin,

    https://share.getcloudapp.com/DOuxywLQ I am seeing the search and the button.

    Could you please clear the cache, check again and get back to us.

    Best regards,
    Victoria

    #1244873

    Hey, sorry I didn’t mention it is just on mobile so the ‘go to top’ button doesn’t show anymore.

    Thanks!

    #1244879

    yes – that is standard behavior on enfold – because a lot of mobile users know that a double tap on top of the browser window has the same effect.

    but you can get it back if you overwrite the rule by:
    ( and to shift the button set the bottom and right position for it as you like )

    @media only screen and (max-width:767px) {
    	.responsive #scroll-top-link {
    		display:block !important;
    		bottom: 10px ;
    		right: 20px;
    	}
    }
    #1245202

    Perfect, thanks!

Viewing 30 posts - 1 through 30 (of 31 total)
  • You must be logged in to reply to this topic.