Tagged: , , ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1016310

    Hello to all,

    I need help with:
    When a visitor is on page (for example) Contact, and user will click in main menu on the item Contact, page is not opened/reloaded again. Nothing is happening.
    Is here somebody who knows some magic php snippet for function.php which will resolve it please?
    I just need to have actual page reloaded from menu, even user is on the same page.

    Thank you!

    Best wishes,
    Milan

    PS: I will be happy when a moderator will fix title – idem to item :D

    • This topic was modified 6 years, 1 month ago by Dude. Reason: idem to item
    #1016336

    Hey Milan,

    Please try to add this code to the child theme functions.php:

    
    function avia_custom_js_footer_code(){
      ?>
    <script type="text/javascript">
        jQuery(document).ready(function(){
            jQuery(".avia-menu a").click(function(){
                location.reload(true);
            });
        });
    </script>
     <?php
      }
      add_action('wp_footer', 'avia_custom_js_footer_code');
    

    Best regards,
    Peter

    #1016481

    Thank you Peter,

    We are nearly there! :) I should say I am using burger menu – so when I will click on burger menu icon, page is reloaded and I don’t have a chance to see menu. Is it possible to add some an exception for the burger menu icon?

    Milan

    PS: thanks for fixing my thread title!

    #1016486

    Hi,

    Please try this code instead:

    
    function avia_custom_js_footer_code(){
      ?>
    <script type="text/javascript">
        jQuery(document).ready(function(){
            jQuery(".avia-menu li:not(.menu-item-avia-special) a").click(function(){
                location.reload(true);
            });
        });
    </script>
     <?php
      }
      add_action('wp_footer', 'avia_custom_js_footer_code');
    

    Best regards,
    Peter

    #1016491

    Perfect, resolved! Thank you very much!

    Have a great day!
    Milan

    #1016503

    Hi!

    Great, glad I could help you :)

    Cheers!
    Peter

    #1188055

    Hi, I still seem to have a problem with the hamburger menu.
    I used the second snippet of code and pasted in the functions.php file; it works superfine on the desktop version, but the mobile menu reloads the same page over and over, regardless what page I click on the menu.
    Can you help me?
    Thanks :)

    #1188215

    Hi grendelica,

    Please start a separate thread, describe your issue there and give us a link to your website.

    Best regards,
    Victoria

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