Skip to content

Snippet: Custom Footer Callout Button HTML Attributes

The following snippet shows how you can modify the footer callout button attributes and change it's class, id or add a custom attribute. This could be useful if you want to conditionally add/remove classes to the callout button so it looks differently for different parts of your site or perhaps add some custom data attributes that can be used for 3rd party integrations.

 * Modify the footer callout button attributes..
 * @link
add_filter( 'totaltheme/footer/callout/button_attributes', function( $attributes ) {
    $attributes['id'] = 'my-custom-id';
    $attributes['class'] = 'my-custom-class';
    $attributes['data-something'] = 'your data-something value';
    return $attributes;
} );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top