Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Center area post/pages (http://forum.bytesforall.com/forumdisplay.php?f=32)
-   -   Keep certain categories of posts from front page list (http://forum.bytesforall.com/showthread.php?t=5542)

paulae Jan 27, 2010 10:05 AM

Keep certain categories of posts from front page list
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.

juggledad Jan 28, 2010 04:50 AM

if (is_front_page() and (!in_category('15') and !in_category('20')))...

paulae Jan 28, 2010 11:31 AM

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:


<?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?

juggledad Jan 28, 2010 12:53 PM


That looks fine.

us1nyc Jun 15, 2010 01:57 PM

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?

juggledad Jun 15, 2010 03:02 PM

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.

All times are GMT -6. The time now is 09:35 AM.

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