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.
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
I want to add an ID to a tag.
Any ideas?
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
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
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