Hey all geeks out there,
I just went through some topics discussing how to embed posts from specific category to a simple page, so that I can benefit from the custom sidebar function, body content of the page and posts styling.
Below are the original code for my page.php category.php and the custom template page I created using the original template page-cat.php
page.php
<div class="inner">
<div class="container">
<div class="main">
<?php the_breadcrumb(); ?>
<div class="box_outer">
<article class="cat_article">
<h1 class="cat_article_title page_title"><?php the_title(); ?></h1>
<div class="single_article_content">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php the_content(); ?>
<div class="clear"></div>
<?php wp_link_pages(); ?>
<?php endwhile; else: ?>
<?php endif; ?>
<?php wp_reset_query(); ?>
</div> <!--Single Article content-->
<?php if(get_post_meta($post->ID, 'mom_page_comments', true)) { ?>
<div class="dots"></div>
<?php comments_template(); ?>
<?php } ?>
</article> <!--End Single Article-->
</div> <!--Box Outer-->
</div> <!--End Main-->
category.php
<div class="inner">
<div class="container">
<?php if(of_get_option('feature_cat_style') == 'full') { ?>
<?php if(of_get_option('cat_feature_on')) { ?>
<?php include TEMPLATEPATH . '/feature-full.php'; ?>
<?php } ?>
<?php } ?>
<div class="main">
<?php the_breadcrumb(); ?>
<?php if(of_get_option('feature_cat_style') == 'default') { ?>
<?php if(of_get_option('cat_feature_on')) { ?>
<?php include TEMPLATEPATH . '/feature.php'; ?>
<?php } ?>
<?php } ?>
<?php if(of_get_option('cat_lv_on')) { ?>
<?php include TEMPLATEPATH . '/latest-video.php'; ?>
<?php } ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php cat_article(); ?>
<?php endwhile; ?>
<?php else: ?>
<!-- Else in here -->
<?php endif; ?>
<?php mom_pagination(); ?>
<?php wp_reset_query(); ?>
</div> <!--End Main-->
page-cat.php
<div class="inner">
<div class="container">
<div class="main">
<?php the_breadcrumb(); ?>
<div class="box_outer">
<?php query_posts('cat=5&showposts=4'); if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php cat_article(); ?>
<?php endwhile; ?>
<?php else: ?>
<!-- Else in here -->
<?php endif; ?>
<?php mom_pagination(); ?>
<?php wp_reset_query(); ?>
</div>
</div> <!--End Main-->
It seems that everything is going well except for the pagination, in the page 2 or 3 or whatever it keeps showing the same first 4 posts.
Also the page contents are not appearing before the posts. I used <?php the_content(); ?> but I didn't work out.
Any recommendations ?