Any Wordpress Hackers Here?

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I should post this on the WP forums, but I figure that I'll get a better quality response here if there happens to be someone who knows the answer .

I've modified the page.php template for my site to display posts from a particular category, by inserting a call to query_posts(&cat=x). I saved this template as, let's say feature_page.php. I also modified index.php to exclude posts from this category on the home page, using a similar call. To be specific here are the two calls:

index.php -
query_posts($query_string . "&cat=-x&posts_per_page=10);

feature_page.php -
query_posts("cat=x&posts_per_page=10);

Both loops contain a call to page_nav() at the bottom.

In index.php the concatenation of the contents of $query_string was necessary to preserve navigation in the new query, because the requested page comes over as a rewritten url and turns into a querystring parameter.

I need the same thing in feature_page.php, but no matter what I do it doesn't work. I'm guessing that since the page name is part of the rewritten url it's breaking the nav somehow. I guess I can declare some variables and build my own navigation, but I'm hoping there's an easier answer.
 

KIAman

Diamond Member
Mar 7, 2001
3,342
23
81
I'm far from a wordpress hacker but the the code looks good except I'd encapsulate the strings with single quotes.

query_posts('cat=x&posts_per_page=10');
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Looks like I missed a closing quote there. Most of the examples I see use single quotes, but the theme I am editing used double. Not sure if changing will make a difference but I'll give it a try. Thanks!
 

NiKeFiDO

Diamond Member
May 21, 2004
3,901
1
76
can you show us the site? I'm not sure what the issue exactly is. There are alternatives to query_posts()

If this is the function I'm thinking of, you can actually only use it once per request.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Originally posted by: NiKeFiDO
can you show us the site? I'm not sure what the issue exactly is. There are alternatives to query_posts()

If this is the function I'm thinking of, you can actually only use it once per request.

It's the first link in my sig, but you can't learn much by looking at it. The 'software' and 'articles' category pages don't handle nav. At the moment that's ok because there aren't enough entries to make it cumbersome yet. The issue is that query_posts handles nav correctly when its used in index.php, but appears not to when used in a page template.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |