How to use existing hook in twentytwelve to all theme of wordpress?
-
I Recently tried to read the tutorial for
wp_footer
and alsotwentytwelve_credits
for creating a sample wordpress plugins.
wp_footer
hook to display the footer beneath the page area.
twentytwelve_credits
hook display the footer in the page footer on a white background.
**For Example:**
I tried this code to show the footer with custom message.[ Moderator note: please wrap code or log lines in backticks or use the code button. ]
<?php function your_function() { echo '<p>This is inserted at the bottom</p>'; } add_action('wp_footer', 'your_function'); ?>
I tried this code after switching a theme to twenty twelve.
<?php function your_function() { echo '<p>This is inserted at the bottom</p>'; } add_action('twentytwelve_credits', 'your_function'); ?>
I find the difference when using different hooks.
wp_footer
hook is working for all themes but it is in bottom of the site.twentytwelve_credits
is working for the twentytwelve theme only. I beleive twentytwelve_credits is the efficient way rather than wp_footer. but its hard to change the hook for every theme. I am not sure is the way to show of the footer with every theme with twentytwelve_credits. Any Possibilities likedo_action('twentytwelve_credits');
.
Any Suggestion would be great.
- The topic ‘How to use existing hook in twentytwelve to all theme of wordpress?’ is closed to new replies.