What is Plugin API Hooks – solution for plugins are not working on wordpress theme

Sponsors

Whenever you developing the new theme. You need to add following code in your theme file.

wp_head

Goes in the HTML <head> element of a theme; header.php template. Example plugin use: add javascript code.

Usage: <?php do_action('wp_head'); ?>

-or- <?php wp_head(); ?>

wp_footer

Goes in the “footer” of a theme; footer.php template. Example plugin use: insert PHP code that needs to run after everything else, at the bottom of the footer.

Usage: <?php do_action('wp_footer'); ?>

-or- <?php wp_footer(); ?>

wp_meta

Typically goes in the <li>Meta</li> section of a theme’s menu or sidebar; sidebar.php template. Example plugin use: include a rotating advertisement or a tag cloud.

Usage: <?php do_action('wp_meta'); ?>

-or- <?php wp_meta(); ?>

comment_form

Goes in comments.php and comments-popup.php, directly before the comment form’s closing tag (</form>). Example plugin use: display a comment preview.

Usage: <?php do_action('comment_form', $post->ID); ?>

Note: don’t forget to add wp_head, wp-footer and wp_meta methods in you theme.

You may like following Articles!

One thought on “What is Plugin API Hooks – solution for plugins are not working on wordpress theme

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>