-
AuthorPosts
-
February 27, 2020 at 10:43 am #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 snippetfunction 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?
February 28, 2020 at 9:59 pm #1188921Hey grendelica,
Please remove this code and let us check without it.
Best regards,
VictoriaMarch 6, 2020 at 1:00 pm #1190852Hello, sorry for the late answer. I have commented the code in functions.php
March 6, 2020 at 9:04 pm #1190995Hi 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,
VictoriaMarch 9, 2020 at 1:06 pm #1191487Everything seems to be working.
Thanks!March 9, 2020 at 1:12 pm #1191491Hi,
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 -
AuthorPosts
- The topic ‘Menu item – problems after removing the reload active page function’ is closed to new replies.
