Howdy all...:)
ok, now adding a jquery slideshow to a thematic child theme is nothing new, i like that nivo slider, it's great.
but i got to thinking that if somebody else was to maintain a site with a home page slideshow, and they don't know coding, how would they upload there images, crop them and sort them for the slideshow.
i did some reading over at Justin Tadlock regarding custom post types, and worked that in with the new featured image function in wp3.0
the results works pretty good so far, i am able to upload any large image and it scales it to the size of the slider, with the title being used as a caption.
i have pasted my experimental code below from my functions.php
//JQuery
function re_init_jQuery() {
if (!is_admin()) {
wp_deregister_script('jquery');
wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');
wp_enqueue_script('jquery');
}
}
add_action('init', 're_init_jQuery');
//nivo script
function nivo_script() {?>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_directory'); ?>/nivo/nivo-slider.css" type="text/css" media="screen" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
<script src="<?php bloginfo('stylesheet_directory'); ?>/nivo/jquery.nivo.slider.pack.js" type="text/javascript"></script>
<?php
}
add_action('wp_head', 'nivo_script');?>
<?php function filter_jquery() { ?>
<?php wp_enqueue_script("jquery"); ?>
<?php
}
add_action('wp_head','filter_jquery');
add_action( 'init', 'create_my_post_types' );
function create_my_post_types() {
register_post_type( 'super_duper',
array(
'labels' => array(
'name' => __( 'Super Dupers' ),
'singular_name' => __( 'Super Duper' )
),
'public' => true,
'supports' => array( 'title', 'thumbnail' ),
)
);
}
if (function_exists('add_theme_support')) {
add_theme_support('post-thumbnails');
set_post_thumbnail_size(960, 300, true);
}
function childtheme_banner() { ?>
<script type="text/javascript">
var J$ = jQuery.noConflict();
J$(window).load(function() {
J$('#slider').nivoSlider();
});
</script>
<div id="banner">
<div id="banner-container">
<div id="slider">
<?php $my_query = new WP_Query( array( 'post_type' => 'super_duper', 'posts_per_page' => 10 ) ); ?>
<?php while ( $my_query->have_posts() ) : $my_query->the_post(); ?>
<?php the_post_thumbnail(array( 960,300 ),array( 'class' => '' )); ?>
<?php endwhile; ?>
</div>
</div>
</div>
<?php
}
add_action('thematic_belowheader','childtheme_banner');
so what i'm asking here is...is this a good idea? or should i be doing it another way, does anyone else know of a better solution or a way to improve what i have done so far, remember it is all about the user, i want to make it a painless as possible for a user to update the slideshow...
could really use a little help here
thanks in advance...J