Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #986120

    Hello,
    What can i do to assign an ID to a button?
    I’m thinking in adding it to its href html tag.
    Thanks in advance.

    #986310

    Hey MarcosDeLauretis,

    I’m not sure I understand the question, are you looking for the button to link to an ID or do you need the ID added to the actual button?

    Best regards,
    Rikard

    #987200

    I want to add an ID to a tag.
    Any ideas?

    #987391

    Hi,

    Thanks for the feedback. So it can be a manual link? If so then you can try something like this in a text block:

    <a href="https://your.site/link" id="your-id">Link text</a>

    Best regards,
    Rikard

    #987473

    i think he likes to add an ID to an Enfold ALB Button!
    There are scripts to achieve this, but then the class should definitely only exist once! – otherwise you will have double ID conflicts !

    give the button itself a unique class (in my case: unique-class )
    add this to functions.php of your child-theme:

    function add_ID_to_unique_class() { 
    ?>
    <script>
    (function($){
    	$(document).ready(function(){ 
      		$('.unique-class .avia-button').attr('id', 'what-you-like');
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_ID_to_unique_class');

    If you have this often – then i would edit that alb element to have an id Input field – put it in child-themes/shortcodes folder and load that.
    Instructions: https://webers-testseite.de/edited-enfold-alb-elements/
    See here: https://pastebin.com/EE3b0wX4
    Download here: https://pastebin.com/dl/EE3b0wX4

    • This reply was modified 6 years, 7 months ago by Guenni007.
    #988249

    if you have downloaded the buttons.php – please redownload again.
    i have inserted that if clause – to avoid inserting id with no value to the other buttons. Thats my careless fault
    new version 2018-07-22 works perfect now

    #988286

    Hi,

    Thanks for sharing @guenni007, much appreciated :-)

    Best regards,
    Rikard

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.