Wednesday 13 September 2017

Add content/script files using WordPress wp_footer hook

There may we some cases were you can't make changes in theme footer file due to its structure, in those cases one footer hook comes handy to add html code/content/script files in your footer which is wp_footer

Below is the way we can us this hook/action:

/**
 * add custom message to footer 
 */

function myFxn() {
   echo 'string';
}

add_action('wp_footer', 'myFxn', 1);





Reference link:
https://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer



Load disqus comments

0 comments