WordPress.org

Ready to get started?Download WordPress

Forums

Using jQuery Effects in Theme Template Files (1 post)

  1. WebmistressM
    Member
    Posted 12 months ago #

    Im currently working on a child theme, creating a single-*.php file for one of my custom content types. The end result is that it will be using some jquery for links generated on each single page of this content type, specifically UI Effects like blind, bounce, fold, etc..

    I have looked over this documentation more than 20 times and I find thee overall documentation confusing when it comes to showing how to use jquery ui effects in themes: http://codex.wordpress.org/Function_Reference/wp_enqueue_script#Default_Scripts_Included_and_Registered_by_WordPress

    I was using the following in my functions.php to no avail:

    function wgm_scripts () {
    wp_enqueue_script( 'jquery' );
    wp_enqueue_script( 'jquery-ui-core' );
    wp_enqueue_script( 'jquery-effects-core' );
    wp_enqueue_script( 'jquery-effects-blind' );
    }
    add_action( 'wp_enqueue_scripts', 'wgm_scripts' );

    Relevant source that shows this as the way to do it:
    http://www.mcnab.co/blog/content-management-systems/jquery-ui-in-wordpress/

    Neither JQuery UI, nor JQuery Effects Core are being loaded. So clearly none of my jquery for the effect blind would work. For kicks, I tried loading one of my theme-specific javascript libraries in wgm_scripts

    function wgm_scripts () {
    
            wp_enqueue_script(
                    'easytabs', get_stylesheet_directory_uri() . '/js/jquery.easytabs.js',
                    	array(
                            'jquery',
                            'jquery-ui-core',
                            'jquery-effects-core'
                    )
            );
    
    }
    add_action( 'wp_enqueue_scripts', 'wgm_scripts' );

    Note that easytabs is installed in my theme folder's js folder and actually doesnt depend on jquery-ui-core or jquery-effects-core to run. However, when I checked my page with firebug again, I noticed that both those libraries loaded.

    Why cant I call the jquery-ui-core or jquery-effects-core in its own wp_enqueue_script statement? Should I be trying to load my jquery-effects-blind and list both jquery-ui-core & jquery-effects-core as dependencies?

Reply

You must log in to post.

About this Topic

  • RSS feed for this topic
  • Started 12 months ago by WebmistressM
  • This topic is not resolved
  • WordPress version: 3.5.2