I have designed a custom theme in wordpress and I am trying to add a link to homepage that will take users to the posts of a particular category... for example
Post from category 1 Post from category 1 Post from category 1 (See all posts from category 1)
Post from category 2 Post from category 2 Post from category 2 (See all posts from category 2)
But for some reason this link is not working and all the links take them to the "featured" category (featured categories id is 261)
Here is the code I am using to pull the list of posts from a category:
<?php query_posts( 'cat=5&posts_per_page=4' ); ?>
<?php get_template_part('news_page_loop'); ?>
And here is the content of the news_page_loop page. Bottom few lines have the code for view all posts link:
<div class="single_post">
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div class="cat-page-thumb-title">
<a href="<?php the_permalink(); ?>">
<?php the_post_thumbnail('home-cat-image', array('class' => 'cat-thumb')); ?>
</a>
<p class="catpage-post-title">
<a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
</p>
<p class="post-meta">
<?php comments_popup_link('0 Reviews', '1 Review', '% Reviews'); ?>
</p>
</div><!--cat page thumb and title-->
<?php endwhile; ?>
<?php endif; ?>
</div><!--single post-->
<div class="page_navi_wp">
<div class="view-more-cat"><?php
$category = get_the_category();
if($category[0]){
echo '<a href="'.get_category_link($category[0]->term_id ).'">View More Posts</a>';
}
?></div>
</div><!--page navi wp-->
What am I doing wrong? Please help. For reference, the site is: http://tour.khujbo.com/
Thank you