Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #584216

    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

    • This topic was modified 8 years, 9 months ago by bsomme1.
    #584227

    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

    #584231

    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.

    #584257

    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

    #746876

    Thanks, works. Is this really the best way to accomplish this?

    #747190

    Hi,

    Yes, it’s the best way to accomplish it along with using a child theme :)

    Best regards,
    Nikko

    #747191

    Cool, thanks:)

    #747367

    Hi,

    Glad we could help :-)

    Please open a new thread if you should have any further questions or problems.

    Best regards,
    Rikard

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Create custom div id field for all AVIA layout builder elements’ is closed to new replies.