-
AuthorPosts
-
July 16, 2018 at 10:26 pm #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.July 17, 2018 at 9:29 am #986310Hey 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,
RikardJuly 18, 2018 at 9:59 pm #987200I want to add an ID to a tag.
Any ideas?
July 19, 2018 at 1:46 pm #987391Hi,
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,
RikardJuly 19, 2018 at 4:32 pm #987473i 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 7 years, 3 months ago by
Guenni007.
July 22, 2018 at 12:23 am #988249if 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 nowJuly 22, 2018 at 7:12 am #988286 -
This reply was modified 7 years, 3 months ago by
-
AuthorPosts
- You must be logged in to reply to this topic.
