Wordpress and Anythingslider Navigation Thumbnails

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2011-01-09T01:01:50Z Indexed on 2011/01/09 3:53 UTC
Read the original article Hit count: 490

Filed under:
|
|

So I am using AnythingSlider in Wordpress. This is why I am trying to call the thumbnails from the original posts. Anything slider will configure thumbnail navigation like this:

function formatText(index, panel) {
  return index + "";
}

$(function () {

    $('.anythingSlider').anythingSlider({
        navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
    });

});

As you can see, the navigationFormatter will allow me to format the nav (including thumbnails) however I want. For example, to format thumbnails, I could do this:

 navigationFormatter : function(i, panel){ // add thumbnails as navigation links
return '<img src="images/th-slide-' + ['civil-1', 'env-1', 'civil-2', 'env-2'][i - 1] + '.jpg">';

} So my issue is getting the wordpress slide images to show up there dynamically, rather than in a folder (as the above example shows). For reference, this is my php query that is pulling the posts image (from a script I've already written:

    <img class="slider-img" style="float:left;" src="<?php if(function_exists('wp_get_post_image')){ echo wp_get_post_image(array( 'return_html' => false, 'width' => 500 )); } ?>" />

I hope this update helps. Thank you guys so much. The Stack overflow community is great!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about Wordpress