Footer – Insert & Move Widgets
-
Dear support,
I have two questions pertaining to the <footer>:
1. Is it possible to move the <div class=”site-footer”></div> inside the actual <footer> object?
2. I need to add a very simple <div> just above the Widget area, however, there is no hook called “generate_before_footer_widgets” – is there an alternative to this hook that will accomplish my goal?
Thank you.
-
Hi there,
- You need to take a copy of the footer.php file from the parent theme, paste it to your child theme folder, change line 25
<div <?php generate_do_attr( 'footer' ); ?>>to<footer <?php generate_do_attr( 'footer' ); ?>>, and change line 51</div>to</footer>. - The hook element is a GP Premium feature, we can not answer questions that are related to the premium plugins per WP’s regulation, please open a support topic in GP’s premium support forum, we will be happy to help there.
My apologies, I’ll repost on premium support. Thank you.
Ying, per my first question, I’ve created a child theme, activated it and I can see the original footer.php output properly by way of the child theme. However, the code on lines 25 and 51 do not match up to your references/revisions. Additionally, I only copied over the footer.php file into the child theme. The Widget block(s) would be in another file, no? I imagine I’d need to combine the two scripts from the respective files, or at the very least, call the Widget in the footer.php – that’s my guess, but I could wrong. Please advise when you can. Thank you.
-
This reply was modified 1 year, 8 months ago by
AP.
However, the code on lines 25 and 51 do not match up to your references/revisionsIt should be, here’s the original file of
footer.php:https://github.com/tomusborne/generatepress/blob/f0227eb702ccfa8345e8b26967edcb9c24301253/footer.php#L25For your second question, we will be answer you in the premium forum, there is a hook you can use.
See image below. That is a screenshot directly from the GeneratePress footer.php file in the parent theme. I have not changed this code whatsoever.

That’s not the file, I meant the
footer.phpin the root folder, the path is/wp-content/themes/generatepress/footer.php🤯 I am so sorry – I feel extra stupid now lol I can handle from here. Thank you!
No worries, it’s confusing, the two files have the same name 🙂
Just keep in mind that only the template files in the theme’s root folder can be overridden using a child theme.
- You need to take a copy of the footer.php file from the parent theme, paste it to your child theme folder, change line 25
The topic ‘Footer – Insert & Move Widgets’ is closed to new replies.
