• Resolved sunghei

    (@sunghei)


    Hey Guys

    I am running the Mimbo3.0 theme with feature content gallery plugin. And i want the post to display from the category “articles” but the first post is always hidden, I try to tweek the if statements, but it would crash if i do anything but the current code. any ideas why?
    for sheimagazine.com

    <?php get_header(); ?>
    <?php if (have_posts()) { ?>
    <div id="content">
     <?php
    	$postCount = 0;
    	$page = (get_query_var('paged')) ? get_query_var('paged') : 1;
          query_posts( 'paged=$page&post_per_page=-1&category_name=Articles&showposts=5');
    // change from $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
    	?>
    <div id="fcg"><?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?></div>
    
    	        <!--END LEAD/STICKY POST-->
    
    		<div id="more-posts">
    		<h3><?php _e('Recent Posts','Mimbo'); ?></h3>
    
    		<?php
    }
    		if( $postcount > 0 && $postcount <= 4 ) {
    		//GETS NEXT FOUR EXCERPTS
    		?>
    
    		<div class="clearfloat recent-excerpts">
    			<a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>">
    <?php echo get_post_image (get_the_id(), '', '', '' .get_bloginfo('template_url') .'/scripts/timthumb.php?zc=1&w=105&h=85&src='); ?></a>
    
    <h4><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a> <span class="commentcount">(<?php comments_popup_link('0', '1', '%'); ?>)</span></h4>
    
    <p class="date"><?php the_time('n/d/y'); ?> &bull; </p>
    			<?php the_excerpt(); ?>
    		</div>
    
    <?php //GETS NEXT HEADLINES
    		}
    		else {
    			ob_start();
    			echo '<li><a href="';
    			the_permalink();
    			echo '">';
    			the_title();
    			echo '</a></li>';
    			$links[] = ob_get_contents();
    			ob_end_clean();
    		}
    		$postcount ++;
    		}
    	}
    	else {
    ?>
    
    <?php } ?>
    
    <?php
    	if(count($links)): ?>
    
    	 <h3><?php _e('Older Posts','Mimbo'); ?></h3>
    	 <ul class="headlines"><?php echo join("\n", $links); ?></ul>
    
    	<?php endif; ?>
    	</div><!--END RECENT/OLDER POSTS-->
    <div id="featured-cats">
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Mimbo Sidebar 2') ) : ?><?php endif; ?>
    </div>
    
    </div><!--END CONTENT-->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Thanks.

Viewing 8 replies - 1 through 8 (of 8 total)
  • the first post is always hidden

    Where? In the featured gallery content or the Recent Posts?

    And for larger blocks of code, you might want to use the WordPress pastebin and post the pastebin url here. It makes life easier for everyone.

    Thread Starter sunghei

    (@sunghei)

    in the recent posts. feature gallery is working fine. I know it is suppose to show in the if( $postcount == 0 but evey i try to remove that and put it into if( $postcount > 0 && $postcount <= 4 ) it doesn’t work.

    p.s thanks for the pastebin tip.

    Thanks

    Try changing:

    if( $postcount > 0 && $postcount <= 4 )

    to:

    if( $postcount >= 0 && $postcount <= 4 )

    Thread Starter sunghei

    (@sunghei)

    Just tried it. It seems to put up a post from a while back for no reason

    Thread Starter sunghei

    (@sunghei)

    15 post back. to be exact

    OK – let’s try another tack. Set if( $postcount > 0 && $postcount <= 4 ) back up again. Then try moving:

    <div id="fcg"><?php include (ABSPATH . '/wp-content/plugins/featured-content-gallery/gallery.php'); ?></div>

    to immediately below <div id="content">. I’m guessing that it might be creating a problem in the Loop. Of course, I could be completely wrong…

    Thread Starter sunghei

    (@sunghei)

    you sir is a genius! I move the div and run if( $postcount >= 0 && $postcount <= 4 ) and all is right with the site! if you are ever in Ann Arbor, Michigan. Drop our website a line, I definitely own you a drink.

    Thanks

    Glad to hear you got it sorted. ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘First post not showing’ is closed to new replies.