1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
<?php echo $pagename= get_the_title(); ?> (<?php $postsInCat = get_term_by('name',"$pagename",'category'); $postsInCat = $postsInCat->count; echo $postsInCat; ?>) <?php $my_query = new WP_Query("category_name=$pagename&showposts=200&orderby=title&order=ASC"); ?> <ul> <?php while ($my_query->have_posts()) : $my_query->the_post(); ?> <li><a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"> <?php the_title(); ?></a></li> <?php endwhile; ?></ul> |
This will find the title of the page (ie. jquery) and display categories of that type.
Use in conjunction with ‘php code widget’. Add this code in ‘php code widget’ and drag to the sidebar.