Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function display_highlights($_category_slug = 'research-highlights', $_count_posts = 3)
- {
- $my_cat = get_category_by_slug($_category_slug);
- $highlights_query = new WP_Query('orderby=date&order=DESC&showposts='.$_count_posts.'&cat='.@$my_cat->term_id);
- if ($my_cat):
- ?>
- <div class="research-highlights">
- <h3><a href="<?php echo get_category_link($my_cat->term_id); ?>"><?php print $my_cat->name; ?></a></h3>
- <?php
- if ($highlights_query->have_posts()):
- ?>
- <ul>
- <?php while ($highlights_query->have_posts()) :
- $highlights_query->the_post();
- global $post;
- ?>
- <li>
- <div class="txt">
- <p><a class="read-more-title-link" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
- </div>
- </li>
- <?php endwhile; ?>
- </ul>
- <a class="lnk-more" href="<?php echo get_category_link($my_cat->term_id); ?>">more</a>
- <?php else: ?> <p>There are no <?php print $my_cat->name; ?> at this time.</p><p>Please check back again soon.</p>
- <?php
- endif;
- ?>
- </div>
- <?php else: ?> <div class="research-highlights"><h3><?php print $my_cat->name; ?></h3><p>The category name has been changed. Please change back to restore feed.</p></div>
- <?php endif;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement