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 » Center area post/pages »

Keep certain categories of posts from front page list


  #1  
Old Jan 27, 2010, 10:05 AM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
I'm on vacation using a laptop that doesn't have all my old WP custom code, and need to stop using Front Page Manager plugin to restrict which categories of posts show up in the center column on the front page. Something about it is not working all of a sudden, so I want to go back to the method I used to use, custom PHP code that would go into the index.php. Something like "if is_home, don't display posts from categories 15 and 20".

Obviously, not in plain English, but PHP code. Anybody have that handy? I don't want to bug Flynn with this now since he's busy with ThemeFrame. Juggledad? Off the top of your head?

By the way, I'm using enhanced recent posts widget to do this in the left column widget.
  #2  
Old Jan 28, 2010, 04:50 AM
juggledad's Avatar
juggledad
 
23,655 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
if (is_front_page() and (!in_category('15') and !in_category('20')))...
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #3  
Old Jan 28, 2010, 11:31 AM
paulae's Avatar
paulae
 
1,333 posts · Feb 2009
Wordpress 3.4.1, Atahualpa 3.7.7
thanks, jd. broke my hand last night slipping on ice...bad typing!

i dug up flynn's code from before and put it in ato/center column/above loop:

Code:
<?php if (is_front_page() && !is_paged() )
     $posts = query_posts($query_string . '&cat=-15,-80'); ?>
seems to be working fine...do you see any problem with this?
  #4  
Old Jan 28, 2010, 12:53 PM
juggledad's Avatar
juggledad
 
23,655 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
ouch!

That looks fine.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #5  
Old Jun 15, 2010, 01:57 PM
us1nyc
 
1 posts · Jun 2010
Is it possible to sort posts on my weblog page regardless the categories? It seems that the posts are sorted and listed descending from last to first in category 1, then from last to first in category 2 etc.

Can I thus show the posts listing from all categories in descending order? I tried editing the center column code but it seems that under water WordPress still uses categories. How can I disable this for my weblog where all posts are displayed?
  #6  
Old Jun 15, 2010, 03:02 PM
juggledad's Avatar
juggledad
 
23,655 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
What would you do if a post was assigned to more than one category?
This is not really a theme question but a question about how to query the wp database. You should do some reading at wordpress.org to understand the database. Posts and categories and how they relate and how the database can be queried. Then you can decide if the query you wish to make is possible.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Display only one category in front page posts majofa Post-Kicker, -Byline & -Footer 8 Dec 24, 2009 01:36 PM
Restrict front page to showing sticky posts only DougBarned Atahualpa 3 Wordpress theme 4 Nov 13, 2009 01:28 PM
Categories not listed on front page Getawaygardens Page & Category Menu Bars 1 Nov 3, 2009 06:22 PM
Inaccurate Number of Posts Showing On Front Page OttO Excerpts, Read more, Pagination 7 Oct 21, 2009 04:27 AM
[SOLVED] Category list not displaying all categories TV Lowdown Page & Category Menu Bars 0 Sep 4, 2009 07:11 AM


All times are GMT -6. The time now is 09:15 PM.


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