Sorting custom post types by recent comments!
-
Hello,
I am trying to sort custom post types by recent comments! the purpose is i am writing a faq plugin and i want to show the latest answers with this thing.
<?php global $wp_query; $wp_query = new WP_Query("post_type=questions&post_status=publish&posts_per_page=10"); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?> <div style="margin:10px;padding:5px;border-bottom:1px dashed #ebebeb;height:auto;"> <div style="float:right;width:60px;margin-left:10px;" class="questions-page-2"> <?php echo get_avatar( get_the_author_email(), '48' ); ?> </div> <div style="float:left;width:450px;" class="questions-page-1"> <h6 class="toggle"><a href="#" style="opacity: 1;"><?php the_title(); ?></a></h6> <div class="toggle_content" style="display: block;"> <div class="block"><?php $content = get_the_excerpt(); echo substr($content, 0, 120); ?> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">... show question</a> </div> </div> </div> <div class="clearboth"></div> </div> <?php endwhile; endif; ?>
i tried some plugins but they were outdated and didnt work with custom post types
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Sorting custom post types by recent comments!’ is closed to new replies.