Posted on Leave a comment

YUI3 Carousel into WordPress Theme is not very difficult in fact

In developing a WordPress Child Theme of the Hybrid Theme Framework by Justin Tudlock, I found out today that in fact it is not that difficult to include YUI3 Carousel into WordPress.

I just used the following code that was given at http://yuilibrary.com.

1. First I copied this YUI3 Gallery Javascript code. Well this is actually an AlloyYUI script that you can see directly at http://yuilibrary.com here:

YUI({
//Last Gallery Build of this module
gallery: 'gallery-2010.08.18-17-12',
modules: {
'gallery-aui-skin-base': {
fullpath: 'http://yui.yahooapis.com/gallery-2010.08.18-17-12/build/gallery-aui-skin-base/css/gallery-aui-skin-base-min.css',
type: 'css'
},
'gallery-aui-skin-classic': {
fullpath: 'http://yui.yahooapis.com/gallery-2010.08.18-17-12/build/gallery-aui-skin-classic/css/gallery-aui-skin-classic-min.css',
type: 'css',
requires: ['gallery-aui-skin-base']
}
}
}).use('gallery-aui-carousel', function(Y) {
var component = new Y.Carousel(
{
intervalTime: 5,
contentBox: '#demonewscontainer',
height: 277
}
).render();
});

//

2. Second I then put this .php code into the theme:

hybrid_get_setting( 'feature_category' ), 'showposts' => hybrid_get_setting( 'feature_num_posts' ), 'ignore_sticky_posts' => true );
else
$feature_query = array( 'post__in' => get_option( 'sticky_posts' ), 'showposts' => hybrid_get_setting( 'feature_num_posts' ) );
?>

etc and so on from “hybrid-news” theme, and finally I can have a YUI3 Carousel displayed WordPress featured posts at my home.php.

There are so many tricks and codes out there, but I am just giving an example that is already working for my WordPress theme.

Please note that did not copy the .php code in full because I do not want to break copyright law, as I do not know the rules yet.

Again, please remember that I am talking about a child theme of Hybrid theme by Justin Tadlock.

I must acknowledge that I am totally new to YUI and WordPress. Totally new means my parents are from the stone-age, still do not read or write, I am the first generation to learn anything an everything, from reading to writing, from modern languages to computers, from php to javascripts. I am leaping from the old stone-aged to postmodern era of communications technology. This YUI and WordPreess project is my own pleasure to dig into it and see what I can get out of it.

Anybody who wants to help me, please email me at: tofreemelanesia@gmail.com

Thank you.

Leave a Reply

Your email address will not be published. Required fields are marked *