I was wondering if it is possible to add a custom div id field to all avia-layout elements (ex. text-block, image, notification, tabs, etc). I know it is possible to add div classes via the functions.php file with this
add_theme_support('avia_template_builder_custom_css');
but I was hoping to use div ID on elements for anchor link purposes. My anchor links don’t always drop down to the appropriate view.
Thanks,
Brad
Hey Brad!
You can add Code Block element to your page and insert following inside it
<div id="my-custom-id"></div>
then add following code to Quick CSS in Enfold theme options under General Styling tab
#my-custom-id { clear: both; }
Regards,
Yigit
That works for the anchor links. is there any way to add a custom text field so that I can insert a custom div id to any avia element though?
Thanks for the quick reply.
Hey!
In that case, you can turn on custom CSS field and give your element a custom CSS class and then add following code to functions.php file in Appearance > Editor
function avia_custom_element_id(){
?>
<script>
jQuery(window).load(function(){
jQuery('.your-custom-class').attr('id','your-custom-id');
});
</script>
<?php
}
add_action('wp_footer', 'avia_custom_element_id');
Regards,
Yigit
Thanks, works. Is this really the best way to accomplish this?
Hi,
Yes, it’s the best way to accomplish it along with using a child theme :)
Best regards,
Nikko
Cool, thanks:)