Home › Forums › JavaScript › [Solved] AnythingSlider & WordPress – the_title(); -> Slidernames › Re: [Solved] AnythingSlider & WordPress – the_title(); -> Slidernames
September 28, 2010 at 4:43 am
#78973
logan91k
Member
@jamy_za, thank you, because of ur post I found a solution… :)
In case anybody else wants to use it, here it is.
This is my “formatText” jQuery function:
function formatText(index, panel) {
var title = $(panel).find("h2").text();
return title;
};
(“panel” contains the full post by default (everything inside the LI))
and this is my “WordPress Loop”:
// The Loop
if (have_posts()) : while (have_posts()) : the_post();
echo '
';
the_post_thumbnail( array(880,880) );
echo '';
the_title();
echo '
';
the_content();
echo '
';
endwhile; else:
echo '
No Content. :-(
';
endif;
?>
works! :-) But only if you have only one H2 Element in the post… a second one could mess this up (not tested)
Oh, and this should be set in the anythingSlider “Options”:
navigationFormatter: formatText // Details at the top of the file on this use (advanced use)