Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #992057

    Hi there,

    I’m trying to add a HTML code to the button: “Luister Live” (in screenshot, coloured button).

    Screenshot

    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!

    #992362

    Hey 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,
    Ismael

    #992392

    Hi there,

    Currently the site is in maintenance mode so it can’t be viewed live..

    #992669

    Hi,

    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,
    Rikard

    #992874
    This reply has been marked as private.
    #993167

    Hi,

    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,
    Ismael

    #993464

    Can 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?

    #993574

    Okay. I added the script to functions.php but nothing happens.

    #993588

    I fixed it!
    Used the plugin Alligator Menu Popup.

    Thanks all!

    #993609

    Hi,

    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,
    Rikard

    #993650

    Topic can be closed now :)

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Button with HTML in Menu’ is closed to new replies.