Display Posts from Specific Category(ies) on Page
-
Hi,
I am using the Sentric theme from Imaginem. It’s nice because I can use a page template to create a blog page that has nicer styling, etc. than the default wordpress category page. The issue is the page pulls all the posts from all categories. We want to display only posts for categories related to that post.
Below is the php file that is populating the code. Can anyone help me with this?
Thanks!
<?php /* Template Name: Blog Small Thumbnails */ ?> <?php get_header(); ?> <?php global $mtheme_pagelayout_type,$mtheme_pagestyle;; $mtheme_pagelayout_type="two-column"; $mtheme_pagestyle= get_post_meta($post->ID, MTHEME . '_pagestyle', true); $floatside="float-left"; if ($mtheme_pagestyle=="rightsidebar") { $floatside="float-left"; } if ($mtheme_pagestyle=="leftsidebar") { $floatside="float-right"; } if ($mtheme_pagestyle=="nosidebar") { $mtheme_pagelayout_type="fullwidth"; } ?> <?php if ($mtheme_pagestyle=="nosidebar") { ?> <div class="fullpage-contents-wrap"> <?php } else { ?> <div class="contents-wrap <?php echo $floatside; ?> two-column"> <?php } ?> <?php if ( get_query_var('paged') ) { $paged = get_query_var('paged'); } elseif ( get_query_var('page') ) { $paged = get_query_var('page'); } else { $paged = 1; } query_posts('paged='.$paged.'&posts_per_page='); ?> <div class="entry-content-wrapper bloglist-small"> <?php get_template_part( 'loop', 'blog' ); ?> </div> </div> <?php if ($mtheme_pagestyle=="rightsidebar" || $mtheme_pagestyle=="leftsidebar" ) { get_sidebar(); } ?> <?php get_footer(); ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Display Posts from Specific Category(ies) on Page’ is closed to new replies.