I've been reading the wordpress codex and it seems that if I want to add some text just before the footer shows up I should use code like this in my functions.php
add_action('wp_footer', 'your_function');
function your_function() {
$content = '<p>This is inserted at the bottom</p>';
echo $content;
}
It is my understanding that the $content should show up just before the footer, but it does not show up at all. Is there another way to show up my code just before the footer ?
I am with WP 2.8 but this should not matter
Sign in to your WordPress dashboard. Go to Appearance → Customize. In the website customization menu, click on Footer. You can edit the footer by using widgets to add new sections or by editing the content and style of the footer bar.
To access the Customizer, go to Appearance -> Customize in your WordPress dashboard. Here's what to look for to edit the footer in the WordPress Customizer: Theme Options – you might find a Theme Footer section where you can customize the colors, border, and text of the footer to fit the site's overall design.
Go to WordPress Dashboard > Templates > ThemeBuilder. Click Add New Template and choose Header (or Footer) Name your header template and click Create Header (or Footer) Now you'll be able to either choose a premade header (or footer) template or create one from scratch.
If you want to add something right before the footer (not in the middle of it), use
add_action('get_footer', 'your_function');
That hook runs when the theme file calls the get_footer()
function.
Your code is valid. Just make sure your theme actually fires the "wp_footer" action: somewhere in footer.php probably there must be either do_action('wp_footer') or wp_footer()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With