StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   Blog Page Template Restrictions (http://www.studiopress.com/support/showthread.php?t=10135)

vvillanova 06-22-2009 10:40 AM

Blog Page Template Restrictions
 
I just launched a new website for my dodgeball league in NYC (bigappledodgeball.com) using the Metro Theme, and it looks fab.

Here's the issue...
When I create a page and apply the standard Blog Page Template, it will only grab posts that are categorized as "News."

What I'd like:
1. A page where all posts, regardless of category, are posted.
2. A page where only posts categorized a different way are posted.

I suspect the issue to be in these lines of code (lines 15 and 17 in the file page_blog.php). I've played around and tried a few different things, but I can't seem to figure it out.

<?php $blog_cat_1 = get_option('metro_blog_cat_1'); $blog_cat_1_num = get_option('metro_blog_cat_1_num'); if(!$blog_cat_1) $blog_cat_1 = 1; //setting a default ?>

<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=".$blog_cat_1."&showposts=".$blog _cat_1_num."&paged=$page"); while ( have_posts() ) : the_post() ?>

Thanks!

Brian Gardner 06-22-2009 11:02 AM

Re: Blog Page Template Restrictions
 
Go into the page_blog.php file and replace this:

Code:

<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("cat=".$blog_cat_1."&showposts=".$blog_cat_1_num."&paged=$page"); while ( have_posts() ) : the_post() ?>
With this:

Code:

<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("showposts=".$blog_cat_1_num."&paged=$page"); while ( have_posts() ) : the_post() ?>

vvillanova 06-22-2009 11:59 AM

Re: Blog Page Template Restrictions
 
Thank you Brian.

Follow-up question: the new code you give here will make it so the blog page grabs all posts. Is there a way to customize it so that one blog page grabs only certain categories (so that I could have one page grabbing posts to one category and another page grabbing posts from another, etc)?

In the code here, the category seems to have a number, and in a similar question (in another post) there was mention of category ID numbers. Where do I find the category ID number?


All times are GMT -5. The time now is 10:47 PM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.