• Resolved LeedsInk

    (@leedsink)


    Hi guys, just a quick query, I am using the Plixus theme on my website, and one of the features is on the Home Page it can display your last 4 blog posts. This is nice, however I am using Blog Posts in categories for other uses too. What I would like is a way of having the blog posts display by category only, I have the category already and the ID.

    I’ve wittled it down to the following code:

    <?php
           $blog_nr = of_get_option('blog_nr', '' ); 
    
    $recent = new WP_Query("showposts=$blog_nr");
    
    	$count2 = 0;
    
    	 if (have_posts()) : 
    
    	while($recent->have_posts()) : $recent->the_post();?> 
    
    	<?php if(($count2 % 4) == 0) {  	?>

    Does anyone have any ideas which part of this I’m changing in order to get it to display categories from either ID of 8 or the slug ‘blog-posts’.

    Thanks for any help.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Blog Posts on Home Page by Category’ is closed to new replies.