![]() |
|
||||||
|
|
Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
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
|
||||
|
||||
|
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() ?>
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
|
|||
|
|||
|
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 | |
|
|
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 |
© Copyright 2012 Copyblogger Media LLC · StudioPress™ is a trademark of Copyblogger Media LLC
Privacy Policy | Refund Policy | Terms of Service | Affiliate Program | Contact Us