Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #1330603

    Hi,

    I want to change the order of the last 4 item of my menu (the search bar, the language switcher, the cart and the login icon) : https://i.imgur.com/SJmf5qB.png

    Is there a way to change the position of the cart and the search bar ?

    The order that I want is : the search bar, the cart, the login icon, and last the language switcher

    I can only change the order of the login icon and the language switcher as they appear on the menu editor

    Thank you for your help

    Best regards,

    #1330604

    To be more precise I made an example of how I want my menu to be displayed via photoshop : https://i.imgur.com/6b9pItx.png

    And this is how my menu is displayed right now : https://vbd9xqvvjh0.c.updraftclone.com

    #1330711

    Hi,
    Thank you for the link to your site and the screenshot, there is not an official way to do this but I tried to work out a script for you, I wrote it to start at 1024px because you have so many menu items that at 768px they overlap, I recommend removing some items or making the burger menu show for larger screens.
    this is the expected results:
    2021-11-27_021.jpg
    Try adding this code to the end of your functions.php file in Appearance ▸ Editor:

    function custom_script() { ?>
        <script>
    (function($){
    var width = $(window).width();
    if ( width >= 1023) {
    $("#header ul.cart_dropdown").detach().insertAfter('#menu-item-3092').css({'display':'block'});
    $("#menu-item-search").detach().insertAfter('#menu-item-3092');
    } else {}
    })(jQuery);
    </script>
        <?php
    }
    add_action('wp_footer', 'custom_script');

    and this code in the General Styling ▸ Quick CSS field

    @media only screen and (min-width: 1023px) { 
    #top .av-main-nav ul#menu-item-shop a.cart_dropdown_link {
        margin: 0;
        left: 0;
        color: inherit;
        position: relative;
        width: auto;
        -webkit-transition: color 0.15s ease-out;
        transition: color 0.15s ease-out;
        padding: 0 20px;
        height: 70px;
        line-height: 70px;
        border:none;
    }
    #top .header_color .main_menu ul#avia-menu ul#menu-item-shop {
        background-color: transparent;
    }
    #top #avia-menu #menu-item-shop {
    	box-shadow: none;
    }
    }

    After applying the css, please clear your browser cache and check.

    Best regards,
    Mike

    #1330841

    Hello Mike,

    Thank you a lot for the script :)

    I couldn’t add the code on my fonctions.php there was an error message : Vos modifications de code PHP ont été annulées en raison d’une erreur sur la ligne 62 du fichier wp-content/themes/enfold-child/functions.php. Veuillez la corriger et réessayer d’enregistrer.
    syntax error, unexpected ‘}’, expecting end of file

    Best regards,

    #1330847

    Hi,
    I couldn’t login with the password above to check, but testing the script on my test site didn’t give any errors, try copying the code again from the forum and not an email, or update the password you posted for us so we can try.

    Best regards,
    Mike

    #1330849

    I just tried again but no changes. You will find my wordpress log in private

    Thank you

    Best regards,

    • This reply was modified 2 years, 12 months ago by sofiadadci.
    #1330850

    One minute please i try something

    #1330854

    It’s okay now

    Thanks

    #1331087

    Hi,
    Thanks for the login, I found that you had an ending PHP tag in your child theme functions.php, I removed it and was able to add the script. I removed it because your main menu doesn’t look the same as when I wrote the script, if you plan to restore it as it was you can now add the script again and test.

    Best regards,
    Mike

    #1331235

    Hi Mike,

    Thank you for your answer. My menu was not the same because at this time I was in the process to migrate my website. Now that it’s done, the official website is https://cleanaireurope.com

    So I did what you have done on the clone website, on my official website : I removed the ending PHP tag then added the script, it worked. Same for the css code, no problem to save changes. The menu order is displaying like I want so I thank you for that

    But there is 2 things :

    1. The cart stay dark even in transparent mode https://i.imgur.com/RJFyoe7.jpeg

    2. Is there a way I can change some part of your script to equalize the gaps between the menu items https://i.imgur.com/Y04EGdp.png ?

    Thank you.

    Best regards,

    #1331248

    Hi,
    Glad this helped, I was not able to view your new site because the password seems incorrect, but the gap around the cart is set by the padding in the css above, so you could try adjusting that, on the test site the spacing seemed good, perhaps you have some other css affecting the menu items?
    2021-11-27_021.jpg

    Best regards,
    Mike

    #1331324

    Hi,

    Oh it’s bizarre for the password. I changed the password and tested it, you should be able to connect now (info in private).

    I tried to adjust the cart gap by changing the padding but it is not changing the gap but the position (the cart sit higher or lower). I tried changing other values of your css, no change.

    Also do you know why the cart stay dark ? I didn’t change anything, just copied and pasted the css from my clone website

    Thank you

    Best regards,

    #1331459

    Hi,
    Thank you, for the cart on a transparent header I added this:

    @media only screen and (min-width: 767px) { 
    #top .av_header_transparency .av-main-nav ul#menu-item-shop a.cart_dropdown_link span:before {
    	color: #fff;
    }
    }
    

    For the menu spacing I added this css:

    @media only screen and (min-width: 767px) { 
    .html_cart_at_menu.html_header_searchicon #menu-item-search.menu-item-search-dropdown {
        padding-right: 0;
    }
    }
    

    2021-12-03_003.jpg
    Please clear your browser cache and check.

    Best regards,
    Mike

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