[Resolved] Add Attribute To Site Footer

Home Forums Support Add Attribute To Site Footer

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1259252
    Jackie

    Hi,

    Just wondering how I would go about adding a custom attribute to the HTML of the site footer.

    I am look to change this:

    <div class="site-footer">

    to this:

    <div class="site-footer" data-aos="fade-up">

    Many thanks.

    #1259900
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    As of right now, it’s not possible without overwriting the entire footer.php file.

    I wonder if there’s an alternative to a data attribute there? It is possible to add a custom class.

    #1262676
    Jackie

    Hi Tom,

    Thanks for your response.

    I could do this but it would mean tweaking the CSS provided from Animate on Scroll which is something I would need to set aside a bit more time to accomplish.

    Another thought, is there anyway of wrapping the site footer into a containing <div>? Adding the attribute to a parent <div> would also solve the problem.

    #1262846
    David
    Staff
    Customer Support

    Hi there,

    you can add a wrapper around the footer with this PHP snippet:

    add_action( 'generate_before_footer', function(){
        echo '<div class="footer-wrapper" data-aos="fade-up">';
    },1);
    
    add_action( 'generate_after_footer', function(){
        echo '</div>';
    },15);
    #1279373
    Jackie

    Hi David,

    That snippet worked a treat. Thanks for your help 🙂

    #1279491
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.