Support » Themes and Templates » How to make blog show only certain category

  • I know this has been answered before, but with the theme I am working with it I am a bit lost because of how it was coded. I need my blog part to only show a certain post category, but when I insert <?php query_posts('cat=1'); ?> before the loop it doesnt work. Here is the code on the blog template:

    <div class="blog">
    <?php } ?>
    <?php if ($query->have_posts()) : while ($query->have_posts()) : $query->the_post(); ?>
    <div <?php post_class('post'); ?>>
    	<?php if(has_post_thumbnail()) { ?>
    	<div class="one-third column featured-image-container ajax-load-item" id="post-image-<?php echo $post->ID; ?>" data-url="<?php echo the_permalink($post->ID); ?>" data-title="<?php echo themex_title($post->post_title); ?>" data-type="post" data-id="<?php echo $post->ID; ?>"><img src="<?php echo resized_thumbnail_url($post->ID,460); ?>" class="bordered featured-image" alt="<?php the_title(); ?>" /></div>
    	<?php if($layout!='left' && $layout!='right') { ?>
    	<div class="two-third column last">
    	<?php } else { ?>
    	<div class="one-third column last">
    	} else { ?>
    	<div class="column full last">
    	<?php } ?>
    		<?php if(get_option('themex_blog_meta')!='true') { ?>
    		<div class="post-meta">
    			<?php _e('','absolute'); ?>
    			<div class="post-time">
    				<span class="post-day">
    					<?php the_time('j'); ?>
    				<span class="post-monthyear">
    					<?php the_time('M Y'); ?>
    			<div class="post-author">
    				<?php the_author(); ?>
    			<?php } ?>
    			<div class="post-tags">
    				<?php the_tags('  ', ' , ', '  '); ?>
    			<?php if(get_option('themex_blog_comments')!='true') { ?>
    			<div class="comments-meta">
    				<?php comments_popup_link( 'Add Comment', '1 Comment', '% Comments', 'post-comments', 'Comments are off for this post'); ?>
    		<?php } ?>
    		<h3 class="post-title"><?php the_title(); ?></h3>
    		<div class="post-excerpt">
    			<?php the_excerpt(); ?>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    The way it calls the loop is different from the standard wordpress way (or at least I think it is) and I am not sure how to edit this to only show category 1 on the blog section of the website.

    Any help is greatly appreciated

Viewing 1 replies (of 1 total)
  • esmi


    Forum Moderator

    I’m sorry but as you are using a commercial theme (noted from a previous topic), you need to seek support from the theme’s developer/vendor. We do not support commercial themes here.

Viewing 1 replies (of 1 total)
  • The topic ‘How to make blog show only certain category’ is closed to new replies.