- This topic has 6 replies, 2 voices, and was last updated 5 years, 3 months ago by
Baz.
-
AuthorPosts
-
December 5, 2020 at 11:07 am #1568670
Baz
Hi, I just need to insert some text after the site footer.
I know I can target the area using
generate_after_footerin Elements, but I won’t be using any other filters/hooks in Elements, so not sure if it’s worth enabling the module for just one filter.Can you please provide the PHP code/syntax I need to add to functions.php
Out of curiosity, would you rather enable the Elements module for only 1 or 2 hooks, or use functions.php? I’m just wary of enabling too many modules if it’s going to increase server calls/resources.
Thank you.
December 5, 2020 at 12:44 pm #1568766Leo
StaffCustomer SupportHi there,
Can you try inserting the text using the footer bar widget area first?
https://docs.generatepress.com/article/footer-bar-widget-area/Then set the alignment to center:
https://docs.generatepress.com/article/footer-bar-widget-area/#footer-bar-alignmentThen we can just tweak the layout with a bit of CSS if needed.
Let me know 🙂
December 5, 2020 at 1:32 pm #1568781Baz
Hi Leo, I can do what you suggested using the footer bar, but I wanted to create a separate container area so I can target with specific CSS (alignment, background etc).
I was able to do this using Elements module, but just wondered if there was a code snippet I could use instead.
I don’t need to add any other code in Elements, so not sure it was worth activating.
Thanks.
December 5, 2020 at 1:34 pm #1568782Leo
StaffCustomer SupportI can do what you suggested using the footer bar, but I wanted to create a separate container area so I can target with specific CSS (alignment, background etc).
We should be able to do that with the footer bar area.
Any chance you can link me to the page in question?
December 5, 2020 at 1:43 pm #1568793Baz
Sorry Leo, it’s on local development.
I was was hoping that there was a snippet I could use to target that area, and insert the text e.g.
add_action( 'generate_after_footer','example_function_name' ); function example_function_name() { ?> <div class="after-footer-area"> Insert my text here... </div> <?php }Apologies if the above is incorrect, I’m still trying to understand PHP.
Thanks.
Hey, I just checked and that actually worked!!! 🙂
December 5, 2020 at 1:48 pm #1568796Leo
StaffCustomer SupportYup that looks good.
But there is really no advantage to do that over the footer bar widget area from what I can tell.
It basically introduces extra functions.
December 5, 2020 at 1:48 pm #1568797Baz
I must have made a typo somewhere.
I hope that’s the correct way to target the after footer area 🙂
I will try your other suggestion too.
Thanks Leo.
-
AuthorPosts
- You must be logged in to reply to this topic.