StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
  #1  
Old 06-22-2009, 10:40 AM
vvillanova vvillanova is offline
Registered User
Pro Plus Member
 
Join Date: Dec 2008
Posts: 7
Default 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!
  #2  
Old 06-22-2009, 11:02 AM
Brian Gardner's Avatar
Brian Gardner Brian Gardner is offline
Administrator
 
Join Date: Sep 2008
Location: Chicago, IL
Posts: 5,360
Default 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() ?>
  #3  
Old 06-22-2009, 11:59 AM
vvillanova vvillanova is offline
Registered User
Pro Plus Member
 
Join Date: Dec 2008
Posts: 7
Default 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?
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
blog page template ifeelok General Discussion 3 07-07-2009 06:31 PM
Blog Page Template craftpassion General Discussion 1 06-01-2009 11:39 PM
Blog Page Template affiliatedragon General Discussion 7 01-27-2009 07:17 AM
Page set to blog template does not appear zedman General Discussion 1 01-02-2009 04:14 PM


All times are GMT -5. The time now is 12:07 PM.

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