Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I Recently tried to read the tutorial for wp_footer and also twentytwelve_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.

<?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 like do_action('twentytwelve_credits');. Any Suggestion would be great.

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

A hook can only be implemented via actual function call. It is not possible without adding that call to theme template directly or via other method (calling it inside another, already available, hook for example).

There is Theme Hook Alliance initiative to promote more standardized hooks in themes and increase flexibility, but adoption have been low so far and usually hooks in theme are specific to it or (at best) to a theme framework used.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.