Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • dayfalljesse

    (@dayfalljesse)

    Luke – did you ever figure this out? I’m having the same issue.
    Thanks!

    Thread Starter dayfalljesse

    (@dayfalljesse)

    Ok, actually now I got it all to load, but its not working now.
    Strange thing is if i put the header code directly in the header.php file, it works. But if i call with the enqueue_script function using the plugin it doesnt.

    any insights?

    here is the new code:

    <?php
    
    /*
    Plugin Name: Tab Header Code
    Plugin URI: [insert the plugin uri here]
    Description: Inserts appropriate javascript and css libraries for tabs
    Author: Jesse Wallace
    Version: 0.1
    Author URI: https://www.enticent.com
    Generated At: www.wp-fun.co.uk;
    */ 
    
    if (!class_exists('tabstyles')) {
        class tabstyles	{
    
    		/**
    		* PHP 4 Compatible Constructor
    		*/
    
    		function tabstyles(){$this->__construct();}
    
    		/**
    		* PHP 5 Constructor
    		*/		
    
    		function __construct(){
    		add_action("init", array(&amp;$this,"add_scripts"));
    		add_action("wp_head", array(&amp;$this,"add_css"));
    		}
    
    		/**
    		* Tells WordPress to load the scripts
    		*/
    
    		function add_scripts(){
    		wp_enqueue_script('tabview', 'https://yui.yahooapis.com/2.7.0/build/tabview/tabview-min.js');
    		wp_enqueue_script('element', 'https://yui.yahooapis.com/2.7.0/build/element/element-min.js');
    		wp_enqueue_script('yahoodom', 'https://yui.yahooapis.com/2.7.0/build/yahoo-dom-event/yahoo-dom-event.js');
    		wp_enqueue_script('connection', 'https://yui.yahooapis.com/2.7.0/build/connection/connection-min.js');
    		}
    
    		/**
    		* Adds a link to the stylesheet to the header
    		*/
    
    		function add_css(){
    		echo '<link rel="stylesheet" href="'.get_bloginfo('wpurl').'/wp-content/plugins/tab-header-code/css/tabstyle.css" type="text/css" media="screen"  />';
    		}
    }
    }
    
    //instantiate the class
    if (class_exists('tabstyles')) {
    	$tabstyles = new tabstyles();
    }
    
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)