Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // get the current category
- $category = get_the_category();
- // get the sticky posts in the category
- query_posts(array( 'post__in' => get_option('sticky_posts'), 'orderby' => 'title', 'post_date' => 'DESC' , 'cat' => ''.$category[0]->cat_ID.'' ));
- ?>
- <?php if (have_posts()) : ?>
- <?php
- if ($cat)
- {echo "<h2>Articles in " . get_the_category_by_ID($cat) . "</h2>";}
- ?>
- <ul id="archive-list">
- <?php while (have_posts()) : the_post(); ?>
- <li class="sticky"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <span>Updated on <?php the_modified_date(); ?> at <?php the_modified_time() ?></span></li>
- <?php endwhile; ?>
- </ul>
- <?php endif; ?>
- <?php
- // get the non-sticky posts in the category
- query_posts(array( 'post__not_in' => get_option('sticky_posts'), 'orderby' => 'title', 'post_date' => 'DESC' , 'cat' => ''.$category[0]->cat_ID.'' ) );
- ?>
- <?php if (have_posts()) : ?>
- <ul id="archive-list">
- <?php while (have_posts()) : the_post(); ?>
- <li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <span>Updated on <?php the_modified_date(); ?> at <?php the_modified_time() ?></span></li>
- <?php endwhile; ?>
- </ul>
- <?php if(function_exists('wp_page_numbers')) { wp_page_numbers(); } ?>
- <?php else : ?>
- <h1 class="center">Sorry, no articles have been published in the <?php if ($cat) {echo "" . get_the_category_by_ID($cat) . "";} ?> category.</h1>
- <?php include (TEMPLATEPATH . '/searchform.php'); ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement