hi there,
so i have been tasked with adding a div (trust pilot) just above the footer.
what i’ve done is copy the footer.php to my child theme & have edited that directly.
/**
* Check if we should display a footer
*/
if( ! $blank && $footer_option != 'nofooterarea' )
{
if( in_array( $footer_option, array( 'all', 'nosocket' ) ) )
{
//get columns
$columns = avia_get_option('footer_columns');
?>
<!-- TrustBox widget - Micro Review Count -->
<div class="trustpilot-widget" data-locale="en-NZ" data-template-id="5419b6a8b0d04a076446a9ad" data-businessunit-id="5f3647b35fb4fe0001a02f29" data-style-height="24px" data-style-width="100%" data-theme="light" data-style-alignment="center">
<a href="#" target="_blank" rel="noopener">Trustpilot</a>
</div>
<!-- End TrustBox widget -->
<div class='container_wrap footer_color' id='footer'>
this achieves what i’m after, but i’m pretty confident this is not the best way to go about it.
would i be better to add it via the functions.php file (somehow)?
Hey Jason,
If you open footer.php, then you will see that there are two actions which you can use before the output of footer content:
/**
* Fired before footer output starts
*
* @since ???
*/
do_action( 'ava_before_footer' );
/**
* Fired after a possible footer container has been added and actual footer output starts
*
. * @since 4.8.6.3
*/
do_action( 'ava_before_footer_output' );
You can use one of those in a function in functions.php instead if you don’t want to override footer.php in your child theme.
Best regards,
Rikard