Clay
Extra info:
Link to Page of Posts on codex: http://codex.wordpress.org/Pages#A_Page_of_Posts
Custom Page template code: (Please do not laugh to hard at my
attempt, well ok laugh)
<?php
/*
Template Name: posts_cat
*/
?>
<?php
// This file is part of the Carrington Blog Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
//
**********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
**********************************************************************
if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
if (CFCT_DEBUG) { cfct_banner(__FILE__); }
get_header();
get_sidebar();
?>
<div id="post-content-<?php the_ID() ?>" <?php post_class('full'); ?>>
<?php
if (is_page() ) {
$category = get_post_meta($posts[0]->ID, 'references', true);
}
if ($category) {
$cat = get_cat_ID($category);
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$post_per_page = 4; // -1 shows all posts
$do_not_show_stickies = 1; // 0 to show stickies
$args=array(
'category__in' => array($cat),
'orderby' => 'date',
'order' => 'DESC',
'paged' => $paged,
'posts_per_page' => $post_per_page,
'caller_get_posts' => $do_not_show_stickies
);
$temp = $wp_query; // assign orginal query to temp variable for
later use
$wp_query = null;
$wp_query = new WP_Query($args);
if( have_posts() ) :
while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
<div id="post-content-<?php the_ID() ?>" <?php
post_class('full'); ?>>
<h1 class="entry-title full-title"><?php the_title() ?></h1>
<div class="entry-content full-content">
<?php
the_content('<span class="more-link">'.__('Continued...',
'carrington-blog').'</span>');
$args = array(
'before' => '<p class="pages-link">'. __('Pages: ', 'carrington-
blog'),
'after' => "</p>\n",
'next_or_number' => 'number'
);
wp_link_pages($args);
?>
<div class="clear"></div>
</div><!--/entry-content-->
<?php endwhile; ?>
<div class="navigation">
<div class="alignleft"><?php next_posts_link('« Older Entries') ?
></div>
<div class="alignright"><?php previous_posts_link('Newer Entries
»') ?></div>
</div>
<?php else : ?>
<h2 class="center">Not Found</h2>
<p class="center">Sorry, but you are looking for something that
isn't here.</p>
<?php get_search_form(); ?>
<?php endif;
$wp_query = $temp; //reset back to original query
} // if ($category)
?>
</div>
<?php
get_footer();
?>
--
To unsubscribe, reply using "remove me" as the subject.
On Apr 7, 9:28 pm, Kai Pan <kai....@gmail.com> wrote:
> Hm, is there a specific reason you want to use a page to replicate the
> category archive function? Why not just call the category archive? Is it for
> URL shortness or something? Even then, you can just use a redirect like Page
> Links To plugin to accomplish the same thing.
>
> On Thu, Apr 8, 2010 at 6:37 AM, clayd <ckdot...@gmail.com> wrote:
> > I am trying to create a Page of Post from a single category. I am
> > looking at the codex for this and do not see how to make it work with
> > the carrington theme. Can someone please help?
>
> > Clay
>
> > Extra info:
> > Link to Page of Posts on codex:
> >http://codex.wordpress.org/Pages#A_Page_of_Posts
>
> > Custom Page template code: (Please do not laugh to hard at my
> > attempt, well ok laugh)
>
> > <?php
> > /*
> > Template Name: posts_cat
> > */
> > ?>
> > <?php
>
> > // This file is part of the Carrington Blog Theme for WordPress
> > //http://carringtontheme.com
> > //
> > // Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
> > //http://crowdfavorite.com
> > //
> > // Released under the GPL license
> > //http://www.opensource.org/licenses/gpl-license.php
On Apr 8, 9:24 am, Kai Pan <kai....@gmail.com> wrote:
> You've never heard of a category archive?
>
Clay
One thing that i dont like about this is that it is going to mess up
my navigation on the side bar seeing that this will need to be a
static link and not a page. Any thoughts on this?
Clay
On Apr 8, 9:44 am, Kai Pan <kai....@gmail.com> wrote:
> Do you have a current public WordPress website? I want to see if it has a
> category link and then point to it and make sure you really don't know what
> a category archive is before moving on. Most themes will display categories
> so I'm having a hard time believing you've never used them before.
>
> Which Carrington version are you using? Carrington Blog?
>
> If you want the category archives to show full posts and only one post, then
> you probably should change the number of posts per archive page to 1 and
> change the category.php file in the /posts/ subfolder so that it calls for
> the content folder instead of the excerpt folder.
>