Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1188370

    Hello,
    when a visitor is in a page, and it clicks on the menu over the same page link, it doesn’t reload the page. My client asked me to make the menu so that it reloads the page you are on if you click on it in the menu (ex. you are in “contact”, and you click “contact” on the menu, it should reload the page instead of bringing you to the top, which is what happens normally).
    I found this thread with this code snippet

    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’);`

    which seems to have solved the issue for the original poster, but my website is still not working correctly. It seems to reload the same page you are in over and over again, instead of bringing you to the page you click on. Can you help me with this?

    #1188921

    Hey grendelica,

    Please remove this code and let us check without it.

    Best regards,
    Victoria

    #1190852

    Hello, sorry for the late answer. I have commented the code in functions.php

    #1190995

    Hi grendelica,

    Please try the code like this:

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

    Best regards,
    Victoria

    #1191487

    Everything seems to be working.
    Thanks!

    #1191491

    Hi,

    Glad Victoria could help! :)

    For your information, you can take a look at Enfold documentation here – https://kriesi.at/documentation/enfold/

    If you have any other questions or issues, feel free to start a new thread under Enfold sub forum and we will gladly try to help you :)

    Best regards,
    Yigit

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Menu item – problems after removing the reload active page function’ is closed to new replies.