Tagged: main menu
-
AuthorPosts
-
December 16, 2014 at 4:46 pm #368964
Hey everyone,
i just tried to implement a “back button” at the main menu of my enfold theme.
Didn’t worked actually … some issues for me ?
thanks a lotDecember 16, 2014 at 6:50 pm #369078Hey tese!
Here is the javascript you can use to create a “back button”, http://stackoverflow.com/questions/13511679/go-back-button-in-a-page.
You cannot add it directly to your menu links in the dashboard but if you know the page ID of your link then you can add the functionality in with javascript. Send us a link and let us know which area your wanting to change.
Regards,
ElliottDecember 17, 2014 at 11:36 am #369397This reply has been marked as private.December 17, 2014 at 7:06 pm #369667Hey!
It looks like you forgot to include a link.
Best regards,
ElliottDecember 18, 2014 at 1:02 pm #369924hey,
if i try : window.history.go(-1);
i get a blankpage in a new window … what should i insert in the link section ?
December 18, 2014 at 7:26 pm #370159Hi!
The link can be set to “#”. The javascript portion needs to be added on the “onclick” attribute.
Regards,
ElliottDecember 19, 2014 at 9:35 am #370478thanks again – but i didn’t understand where i have to paste the javascript // where i could define the onclick attribute.
cheerio
December 19, 2014 at 12:24 pm #370519I am not sure if i formulate my request correct ;)
or if i just passed something at the Site, that you recommended to me.so i hope you could explain it to me – step by step !
°Best regards !
December 19, 2014 at 9:12 pm #370762Hi!
Send us a link to your site so we can see the ID of this “zuruck” button and we’ll give you some code to use.
Best regards,
ElliottDecember 19, 2014 at 9:18 pm #370766December 20, 2014 at 6:15 pm #371001Hi!
Try adding this to the bottom of your functions.php file.
add_action( 'wp_footer', 'enfold_customization_back_button' ); function enfold_customization_back_button(){ ?> <script type = "text/javascript"> jQuery(docment).ready(function(){ jQuery("#menu-item-524 a").attr('onclick', 'window.history.go(-1);'); }); </script> <?php }
Regards,
ElliottDecember 20, 2014 at 10:01 pm #371049Thanks :
Done! But it actually doesn’t work. Did i miss something?
Best Regards!
December 20, 2014 at 10:57 pm #371079Hey!
There is a typo in Elliot’s code, try with this:
add_action( 'wp_footer', 'enfold_customization_back_button' ); function enfold_customization_back_button(){ ?> <script type = "text/javascript"> jQuery(document).ready(function(){ jQuery("#menu-item-524 a").attr('onclick', 'window.history.go(-1);'); }); </script> <?php }
Cheers!
JosueDecember 21, 2014 at 1:54 am #371117Thanks a lot you two !
Works fine !Best regards !
December 21, 2014 at 5:27 am #371151You are welcome, glad we could help :)
Regards,
Josue -
AuthorPosts
- The topic ‘history back button at main menu’ is closed to new replies.