I've been trying to use numerous jQuery plugins for tabling sorting in WordPress and have had absolutely no luck. Can anyone make a suggestion for a plugin that sorts tables of dynamic content?
I'm using the following code to generate the table:
$args=array(
'post_type' => 'page',
'post_status' => 'publish',
'cat' => 1,
'posts_per_page' => 10,
'caller_get_posts'=> 1
);
$c = 0;
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) { ?>`
<table id="actArchive" class="tablesorter activity-archives" summary="This is the activities archive table">
<thead>
<tr>
<th>Activity</th>
<th>Episode</th>
<th>Learning Goal</th>
<th>Description</th>
</tr>
</thead>
<?php
while ($my_query->have_posts()) : $my_query->the_post();
$epititle = get_post_meta($post->ID, '_pbsparents_rept', true);
$learninggoal = get_post_meta($post->ID, '_pbsparents_replg', true);
$description = get_post_meta($post->ID, '_pbsparents_actshortdesc', true); ?>
<tbody>
<tr class="<?=($c++%2==1) ? 'odd' : 'even' ?>">
<td><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></td>
<td><?php echo $epititle; ?></td>
<td><?php echo $learninggoal; ?></td>
<td><?php echo $description; ?></td>
</tr>
</tbody>
<?php endwhile; ?>
</table>
<?php }
wp_reset_query();
Currently I'm attempting to use tablesorter.js to sort things and I've got everything working but when I click on the headings I want to sort, nothing happens.
On edit: Posting jQuery
$js162(function(){
$js162("table").tablesorter({
headers: {
0: { sorter: "text" },
1: { sorter: "digit" },
2: { sorter: false },
3: { sorter: false }
}
});
});