• kzblog

    (@kzblog)


    Using Mimbo 3.0 free edition.

    This theme automatically takes your most recent post and provides an extract with a different background and a thumbnail at the top of the page. Trying to modify it so that posts in certain categories are excluded from that lead post, but still show on the homepage.

    Been playing around with PHP but I know nothing about it, so could use some advice. The code that selects the lead post is:

    <?php
    	$postCount = 0;
    	$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
    	query_posts( 'paged=$page&post_per_page=-1&cat=' . get_query_var('cat') );
    	while (have_posts()) { the_post();
    		if( $postcount == 0 ) {
    		//GETS LATEST OR STICKY POST
    	?>

    I tried changing it to:

    while (have_posts()) { the_post();
    		if( $postcount == 0 && cat=-5) {
    		//GETS LATEST OR STICKY POST
    	?>

    but when the latest post was in category 5, that resulted in no lead post at all.

    If I changed
    if( $postcount == 0 ) to if( $cat=-5)
    that excludes my category, but how do I phrase: else repeat the function again?
    I’d be grateful if anyone could help me.

  • The topic ‘Mimbo Theme: Exclude Posts from Lead Story’ is closed to new replies.