-
AuthorPosts
-
July 31, 2018 at 7:46 pm #992057
Hi there,
I’m trying to add a HTML code to the button: “Luister Live” (in screenshot, coloured button).
This should open a new browser window with custom dimensions.
I can add the HTML code but it isn’t displayed properly.
It just creates a new text line with a link under the menu.Thanks in advance!
- This topic was modified 6 years, 3 months ago by KevinWijnbergen.
August 1, 2018 at 12:38 pm #992362Hey KevinWijnbergen,
Thank you for using Enfold.
Where can we see the button? Please provide the link to the actual page with the issue.
Best regards,
IsmaelAugust 1, 2018 at 1:32 pm #992392Hi there,
Currently the site is in maintenance mode so it can’t be viewed live..
August 2, 2018 at 5:06 am #992669Hi,
Thanks for the feedback. Please post temporary admin login details in private if the site is in maintenance mode so that we can view it.
Best regards,
RikardAugust 2, 2018 at 1:50 pm #992874This reply has been marked as private.August 3, 2018 at 10:53 am #993167Hi,
Where did you add the html code? These are the available parameters for the window.open function.
// https://www.w3schools.com/jsref/met_win_open.asp
Use the “wp_footer” action hook to create an inline script which listens for a specific menu item click event.
add_action('wp_footer', 'ava_open_luister_live', 9999); function ava_open_luister_live() { ?> <script> (function($) { $('#menu-item-3216').on('click', function(e) { e.preventDefault(); window.open("https://www.w3schools.com"); }); })(jQuery); </script> <?php }
Add that script in the functions.php file and modify as required.
Best regards,
IsmaelAugust 4, 2018 at 9:07 am #993464Can you tell me how to do this, step by step?
I added the code to functions.php file, but it can’t be saved because of some errors in the script?August 4, 2018 at 8:27 pm #993574Okay. I added the script to functions.php but nothing happens.
August 4, 2018 at 11:30 pm #993588I fixed it!
Used the plugin Alligator Menu Popup.Thanks all!
August 5, 2018 at 6:48 am #993609Hi,
Great, glad you found a solution and thanks for sharing. Please let us know if you should need any further help on the topic or if we can close it.
Best regards,
RikardAugust 5, 2018 at 11:06 am #993650Topic can be closed now :)
-
AuthorPosts
- The topic ‘Button with HTML in Menu’ is closed to new replies.