Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Excerpts, Read more, Pagination »

[SOLVED] Preserving next/previous navigation with query_posts


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
 
Prev Previous Post   Next Post Next
  #1  
Old Aug 5, 2009, 07:56 AM
leer
 
5 posts · Jun 2009
Help [SOLVED] Preserving next/previous navigation with query_posts

Hi,

I'm using query_posts to exclude a category subtree from my home page, which is breaking next/previous navigation (http://expat.cl/page/2 shows the same posts as http://expat.cl/).

It appears that this is the issue: http://stylizedweb.com/2008/08/13/qu...ation-problem/

I implemented the solution shown on that page, but the behavior remains. Since I'm new to WordPress and PHP, before I start hacking away at Atahualpa I thought I'd run the issue by you all- I may just need a simple correction. I'm using WP 2.8.2 and Atahualpa 3.4.2.

In ATO->Content ABOVE the LOOP I've added:

Code:
<?php /* expat.cl */ if(is_front_page()) { userfn_ignore_directory_posts(); } ?>
That function, located in a separate file, is:

Code:
/*
* Exclude posts belonging to Directory subcategories from Loop
* For use on front page
*/
function userfn_ignore_directory_posts() {
	$pagenum = (get_query_var('pagenum')) ? get_query_var('pagenum') : 1; // preserve pagination
	$dircats = get_categories('child_of=3'); // array of subcategories of Directory	
	$catarray = array();
	$i = 0;
	foreach ($dircats as $cat) { // comma-separated list of negated categories
		$catarray[$i] = $cat->term_id;
		$i++;
	} 
	query_posts(array('category__not_in' => $catarray, 'paged' => $pagenum));
}
As far as the category exclusion goes, the function works.

Thanks,
Becca
 

Bookmarks

Tags
navigation, next/previous, pagination

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Home Link in Next/Previous not working turbojesse Atahualpa 3 Wordpress theme 5 Aug 20, 2009 08:27 PM
[SOLVED] How to style the Previous/Next Navigation links Fux Header configuration & styling 6 Aug 16, 2009 08:41 AM
[SOLVED] After Update 3.4: Problem: Error with Next/Previous Navigation, No Postings! Doc GermaniCus New Versions, & Updating 6 Jul 15, 2009 02:13 PM
[SOLVED] How do I move next/previous navigation to the bottom of the post evany Post-Kicker, -Byline & -Footer 1 Jun 7, 2009 06:41 AM
next and previous navigation in the consulted category lkjc Page & Category Menu Bars 4 Jun 1, 2009 05:25 PM


All times are GMT -6. The time now is 10:39 PM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.