I'm not sure why this script is not loading or producing any load errors via Firebug. Here is my plugin script:
class AV_Slideshow{
function __construct(){
$this->hooks();
}
function hooks(){
add_action('wp_head', array( $this, 'load_av_slider' ));
}
function load_av_slider(){
wp_register_script('av-slideshow', get_bloginfo('stylesheet_directory') . '/js/AV-Slideshow/av_slideshow.js', array('jquery') );
wp_enqueue_script('av-slideshow' );
}
function build_slideshow($slides){
if(!$slides){$slideshow = 'No posts are selected for this slideshow.';}
$slideshow = '<div id="slides"><div class="slides_container">';
foreach($slides as $post_id){
$post = get_post($post_id);
$title = $post->post_title;
$content = $post->post_content;
$slideshow .= '<span>' . $title . '</span><span>' . $content . '</span>';
}
$slideshow .= '</div></div>';
return $slideshow;
}
}
add_shortcode( 'slideshow', array('AV_Slideshow', 'build_slideshow') );
?>
The $slideshow
output is working but the script never loads. Am I loading this correctly?