Permalink
Browse files

Fix bug with sticky posts on archives.

  • Loading branch information...
1 parent 53600ea commit c3e3230f62be65d6a29f2567e0eb8eb4570b5e97 @mindctrl committed Apr 12, 2012
Showing with 11 additions and 8 deletions.
  1. +4 −6 archive.php
  2. +5 −0 changelog.txt
  3. +1 −1 inc/template-tags.php
  4. +1 −1 style.css
View
@@ -16,8 +16,6 @@
<div id="content" role="main" class="span9">
<?php alienship_archive_page_title(); ?>
<?php
- // global $wp_query;
- // $temp = $wp_query;
alienship_archive_sticky_posts(); // sticky post query ?>
<?php if ( have_posts() ) : ?>
@@ -26,19 +24,19 @@
<?php if ( of_get_option('alienship_content_nav_above') ) { alienship_content_nav( 'nav-above' ); } ?>
<?php // do the main query without stickies
- // $wp_query = $temp;
- if ( is_category() ) {
+ $sticky = get_option( 'sticky_posts' );
+ if ( is_category() && ! empty($sticky) ) {
$cat_ID = get_query_var('cat');
$args = array(
'cat' => $cat_ID,
'post_status' => 'publish',
- 'post__not_in' => array_merge($do_not_duplicate,get_option( 'sticky_posts' )),
+ 'post__not_in' => array_merge($do_not_duplicate,get_option( 'sticky_posts')),
'ignore_sticky_posts' => 1,
'paged' => $paged
);
$wp_query = new WP_Query( $args );
}
- elseif (is_tag() ) {
+ elseif (is_tag() && ! empty($sticky) ) {
$current_tag = single_tag_title("", false);
$args = array(
'tag_slug__in' => array($current_tag),
View
@@ -1,4 +1,9 @@
== Change log ==
+Version .61 - April 11, 2012
+----------------------------
+- Fix bug with sticky posts on archives.
+
+
Version .60 - April 11, 2012
----------------------------
View
@@ -419,7 +419,7 @@ function alienship_archive_sticky_posts() {
if ( $sticky_posts->have_posts() ):
global $post;
while ( $sticky_posts->have_posts() ) : $sticky_posts->the_post();
- $do_not_duplicate[] = $post->ID;
+ array_push($do_not_duplicate, $post->ID);
$format = get_post_format();
if ( false === $format )
$format = 'standard';
View
@@ -4,7 +4,7 @@ Theme URI: http://www.johnparris.com/alienship/
Author: John Parris
Author URI: http://www.johnparris.com/alienship/
Description: Alien Ship is an HTML5 responsive starter theme for WordPress.
-Version: 0.60
+Version: 0.61
License: GNU General Public License
License URI: license.txt
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.