WordPress Theme – wp_enqueue_script() and Conditional Tags

March 06th, 2009 | Author: Sunny

Conditional Tag:

Using Conditional Tags for testing whether a certain condition is met, and then returns either TRUE or FALSE.

For example,
is_home() will return TRUE if the main blog page is being displayed.

Some of the conditional tags may contain parameters for conditions.  More information can be found here: http://codex.wordpress.org/Conditional_Tags
Function: wp_enqueue_script():

wp_enqueue_script(handle, src, deps, ver) is a function for adding Javascripts to a WordPress generated page.  It accepts four parameters:

Usage: wp_enqueue_script(handle, src, deps, ver)
handle - (string) Name of the script. Lowercase string.
src - (string) (Optional) Path to the script from the root directory of WordPress. Default is false.
deps - (array) (Optional) Array of handles of any script that this script depends on; scripts that must be loaded before this script.  Default is false.
ver - (string) (Optional) String specifying the script version number, if it has one. Defaults is false.

Category: WordPress | Tags: :, , | 1 Comment

One Response to “WordPress Theme – wp_enqueue_script() and Conditional Tags”

  1. UFC betting says:

    Interesting site, nice design, i have bookmarked it for the future referrence

Leave a Reply

You must be logged in to post a comment.