StudioPress Community Forums

StudioPress Community Forums (http://www.studiopress.com/support/index.php)
-   General Discussion (http://www.studiopress.com/support/forumdisplay.php?f=7)
-   -   Blogs for two independent categories? (http://www.studiopress.com/support/showthread.php?t=21456)

bootzilla 02-11-2010 01:57 AM

Blogs for two independent categories?
 
Hey everyone,

Sorry if I am asking a noob question - I've been searching the forum and haven't really found my specific situation yet.

Here is what I am trying to do - I basically have two different post categories that I want to display on two different blog pages on my site.

So on my main page, you might see all my new posts regardless of category, but in the nav bar, there is a link that goes to a blog page displaying only posts in category "A", and then another nav bar link to a blog page that only displays posts in category "B"

Is this possible? In my dashboard, I can only select a global category for blog posts, so I am not sure how to separate things into two different blog pages.

No biggie if it is not possible, but I have the feeling I am missing something obvious that I would have picked up on if I wasn't so burned out today...

Thanks for the help!

Todd.
.

Debra 02-11-2010 04:33 AM

So two approaches to this.

first your archive page acts this way anyway, listing all posts from a certain category

second you can create a second blog template though the category will not be set via options.

If you let me know what theme you are using I can move this post there and help you with the code.

bootzilla 02-11-2010 02:13 PM

Ahh, I think I see - so if I make another template that is exactly like the blog template - then I could manually insert the category, even though I wouldn't see it on my dashboard.

I've never done that before, so I'll search the tutorials and forum for more info, but I am using Agent theme, so if you bounce this thread over there and anyone has already done something similar, any advice is greatly appreciated.

Thanks Debra!

Todd.
.

Debra 02-11-2010 06:18 PM

Insert your new template name. look for cat=1 and change the one to the category ID you want to pull, and insert the title you want on the page.


PHP Code:

<?php
/*
Template Name:NEW TEMPLATE NAME
*/
?>

<?php get_header(); ?>

<div id="content">

    <div id="contentleft">
    
        <div class="postarea">
            
            <h5>TITLE HERE</h5>
                
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1query_posts("cat=1&showposts=5&paged=$page"); while ( have_posts() ) : the_post() ?>
            
            <h1><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h1>
                
            <div class="date">
                <p><?php the_time('F j, Y'); ?> <?php _e('by''studiopress'); ?> <?php the_author_posts_link(); ?> &middot; <a href="<?php the_permalink(); ?>#respond"><?php comments_number('Leave a Comment''1 Comment''% Comments'); ?></a>&nbsp;<?php edit_post_link('(Edit)'''''); ?></p>
            </div>
                
            <?php the_content(__('[Read more]'));?><div class="clear"></div>
                
            <div class="postmeta2">
                <?php _e('Tagged:''studiopress'); ?> <?php the_tags(''?>
            </div>
                            
            <?php endwhile; ?>
            
            <p><?php posts_nav_link(); ?></p>
        
        </div>
        
    </div>
    
<?php get_sidebar(); ?>
        
</div>

<?php get_footer(); ?>



All times are GMT -5. The time now is 04:27 AM.

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