Skip to content
This repository
Browse code

Fix bug with sticky posts on archives.

  • Loading branch information...
commit c3e3230f62be65d6a29f2567e0eb8eb4570b5e97 1 parent 53600ea
authored
10 archive.php
@@ -16,8 +16,6 @@
16 16 <div id="content" role="main" class="span9">
17 17 <?php alienship_archive_page_title(); ?>
18 18 <?php
19   - // global $wp_query;
20   - // $temp = $wp_query;
21 19 alienship_archive_sticky_posts(); // sticky post query ?>
22 20 <?php if ( have_posts() ) : ?>
23 21
@@ -26,19 +24,19 @@
26 24 <?php if ( of_get_option('alienship_content_nav_above') ) { alienship_content_nav( 'nav-above' ); } ?>
27 25
28 26 <?php // do the main query without stickies
29   - // $wp_query = $temp;
30   - if ( is_category() ) {
  27 + $sticky = get_option( 'sticky_posts' );
  28 + if ( is_category() && ! empty($sticky) ) {
31 29 $cat_ID = get_query_var('cat');
32 30 $args = array(
33 31 'cat' => $cat_ID,
34 32 'post_status' => 'publish',
35   - 'post__not_in' => array_merge($do_not_duplicate,get_option( 'sticky_posts' )),
  33 + 'post__not_in' => array_merge($do_not_duplicate,get_option( 'sticky_posts')),
36 34 'ignore_sticky_posts' => 1,
37 35 'paged' => $paged
38 36 );
39 37 $wp_query = new WP_Query( $args );
40 38 }
41   - elseif (is_tag() ) {
  39 + elseif (is_tag() && ! empty($sticky) ) {
42 40 $current_tag = single_tag_title("", false);
43 41 $args = array(
44 42 'tag_slug__in' => array($current_tag),
5 changelog.txt
... ... @@ -1,4 +1,9 @@
1 1 == Change log ==
  2 +Version .61 - April 11, 2012
  3 +----------------------------
  4 +- Fix bug with sticky posts on archives.
  5 +
  6 +
2 7
3 8 Version .60 - April 11, 2012
4 9 ----------------------------
2  inc/template-tags.php
@@ -419,7 +419,7 @@ function alienship_archive_sticky_posts() {
419 419 if ( $sticky_posts->have_posts() ):
420 420 global $post;
421 421 while ( $sticky_posts->have_posts() ) : $sticky_posts->the_post();
422   - $do_not_duplicate[] = $post->ID;
  422 + array_push($do_not_duplicate, $post->ID);
423 423 $format = get_post_format();
424 424 if ( false === $format )
425 425 $format = 'standard';
2  style.css
@@ -4,7 +4,7 @@ Theme URI: http://www.johnparris.com/alienship/
4 4 Author: John Parris
5 5 Author URI: http://www.johnparris.com/alienship/
6 6 Description: Alien Ship is an HTML5 responsive starter theme for WordPress.
7   -Version: 0.60
  7 +Version: 0.61
8 8 License: GNU General Public License
9 9 License URI: license.txt
10 10 Tags: blue, green, silver, red, orange, white, black, light, dark, one-column, two-columns, right-sidebar, fixed-width, flexible-width, custom-colors, custom-header, custom-menu, threaded-comments, translation-ready, sticky-post, rtl-language-support, microformats, featured-images, post-formats

0 comments on commit c3e3230

Please sign in to comment.
Something went wrong with that request. Please try again.