Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Page & Category Menu Bars (http://forum.bytesforall.com/forumdisplay.php?f=10)
-   -   Only one category in center column (http://forum.bytesforall.com/showthread.php?t=2573)

majofa Jul 22, 2009 07:44 AM

Only one category in center column
 
I want to display only one category in the center column, but I have not been able to figure out how to make it work.

My center column displays all categories in the site.

Flynn Jul 22, 2009 09:57 PM

You can set query_posts right before the "Loop" begins http://codex.wordpress.org/Template_Tags/query_posts

Put the code at the bottom of Style & edit CENTER COLUMN -> Content ABOVE the LOOP

i.e.

<?php query_posts('cat=12'); ?>

Sakshin Aug 13, 2009 06:15 AM

Helpfull, but if I want to have a different categorie on different static pages? Then I glue in the above code into the text area of each page with the corresponding cat nr.?

Flynn Aug 13, 2009 02:24 PM

You're basically replicating what's already built into WP, no? A category page when clicked would list all posts filed in that category.

The code for doing this with query_posts regardless would be

<?php
if ( is_page('Page Title') ) query_posts('cat=12');
if ( is_page('Other Page Title') ) query_posts('cat=22');
if ( is_page('Yet Page Title') ) query_posts('cat=32');
if ( is_page('One More Page Title') ) query_posts('cat=42');
?>


All times are GMT -6. The time now is 12:57 PM.

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