• 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.

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    You can’t use Twenty Twelve specific or any theme specific hooks in other themes.

    I beleive twentytwelve_credits is the efficient way rather than wp_footer. but its hard to change the hook for every theme.

    It’s not really more efficient exactly. If you are making your own theme or modifying a theme then having something like twentytwelve_credits is convenient. But wp_footer does work, you just have to possibly do more work to get the output styled the way you really want.

    Thread Starter Vignesh Pichamani

    (@viky081)

    Ok thanks for Spending Valuable Time.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to use existing hook in twentytwelve to all theme of wordpress?’ is closed to new replies.