Add WordPress jQuery to cutom page template

前端 未结 1 805
心在旅途
心在旅途 2021-01-25 05:07

I have a plugin and it has a below custom page template. This template requires jQuery. I\'ve a variable $link_to_js liked to google library but I want it to link it to the Word

相关标签:
1条回答
  • 2021-01-25 05:34

    You should include <?php wp_head(); ?> and <?php wp_footer(); ?> immediately before </head> and </body> respectively.

    These functions are what, among other things, include scripts and styles that have been queued.

    References:

    • http://codex.wordpress.org/Function_Reference/wp_head
    • http://codex.wordpress.org/Function_Reference/wp_footer

    At the very least add <?php do_action("wp_enqueue_scripts"); ?> as that will output all the queued scripts.

    0 讨论(0)
提交回复
热议问题