![]() ![]() In this way you don't need in-line scripts nevermore. do some stuff with oFoo (no PHP needed) * bool $in_footer (optional) Whether to enqueue the script before or before įunction enqueue_inline_script( $handle, $js, $deps = array(), $in_footer = false ) ![]() * array $deps (optional) Array of script names on which this script depends * string $handle Identifying name for script You can insert any kind of script into the two input. It adds your scripts to either the wphead or the wpfooter action hooks. It has a simple user interface with just two text areasone for the header and one for the footer scripts. * placed in header, and the dependant in footer). Insert Headers and Footers is a good example of a plugin that allows you to edit header and footer templates. * any inline scripts it depends on, (unless they are * KNOWN BUG: Inline scripts cannot be enqueued before This solution is similar to answer, but it follows the form of wp_enquque_script(), and will place the script in the header if its dependencies are included in the header. And always load/enqueue scripts and styles via the wpenqueuescripts action hook, as this is the proper hook to use.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |