Wordpress Themes - WP Forum at BFA
Click here to register or to donate.
Auto self-registration is not available here - far too many spammers. This forum has many, many backlinks and because of that there is an intense desire among spammers to drop their links here.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Page & Category Menu Bars »

Older / Newer links and excluding category

Old Feb 20, 2011, 08:30 AM
vCopia's Avatar
72 posts · Jan 2011
Long Island, NY
I have the following code inserted Above The Loop in the ATO to exclude category #3 from appearing on the main pages of the web site (or search for 'em, etc.).

PHP Code:
<?php if (is_front_page() && !is_paged() )
$posts query_posts($query_string '&cat=-3'); ?>
Didn't think it through, though, because it does exactly what I asked it to... exclude cat 3 from the front page (only). When I click on the Older / Newer links, category 3 posts reappear. The idea was to create the illusion to visitors that category 3 posts weren't part of the main site, and were only accessible if you clicked the page tab I have set up for them.

After reading another posts herein I tried this code instead:

PHP Code:
if (is_home() and !(is_paged()) ) {
Got the same result - worked on front page, but not older / newer pages. Makes sense.

Figured I either needed to:
  • change is_home or is_front_page to another command,
  • expand that section to include a command that referred to the Older / Newer links, or
  • add another segment of of code identical to the above and replace is_home or is_front_page with a tag that referred to whatever the Older / Newer links are IDed as.

Just know I ain't got it right. Please share any insights you have that'll bring my coding prowess up to speed with my goal so I can resume my spot at the clever table. Thanks.
Old Feb 20, 2011, 12:25 PM
juggledad's Avatar
23,697 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
you need to test to see if you are paged and pass that to the query_post
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
Old Feb 20, 2011, 01:02 PM
vCopia's Avatar
72 posts · Jan 2011
Long Island, NY
Got it! Thanks for the direction. Here's what I used and it seems to be working perfectly.

PHP Code:
if (is_home()) {
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
If you see an issue I haven't foreseen with this string, please let me know. Otherwise, I think my Seat has been restored. Thanks.
Old Nov 2, 2011, 01:18 PM
1 posts · Nov 2011
If I'm understanding Wordpress and Atahualpa correctly, I'm having a similar problem. I have a category that I want only accessible if a user selects that tab from the menu. I don't want it to appear as a prev/next option when someone is reading a post. I inserted the above code on the top of my wp-content/themes/Atahualpa/index.php page: the unwanted category doesn't show up on the home page (good!); however, it does appear in prev/next on blog posts (bad!). Please advise: am I putting the code in the wrong spot? Or am I misreading what is written here and I need a different code? Thanks in advance!


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
Thread Thread Starter Forum Replies Last Post
Older Newer entries tags raddy59 Center area post/pages 1 Jan 16, 2011 12:22 PM
Changing Font size for NEWER/OLDER ENTRIES steven72dragon Page & Category Menu Bars 3 Jul 29, 2010 06:52 PM
Older/Newer Errors LindaMuller Atahualpa 3 Wordpress theme 4 Mar 9, 2010 05:28 AM
NEWER / OLDER orientation not working bseppa Atahualpa 3 Wordpress theme 9 Aug 27, 2009 09:35 AM

All times are GMT -6. The time now is 11:32 PM.

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