Support » Themes and Templates » Cannot get posts to display on homepage – any help?

  • simmsimaging

    (@simmsimaging)


    Wondering if any WP gurus could spare a moment to look at a template for me. I have a homepage that displays some recent work in two sections, and one is showing thumbnails, one isn’t. I would like to see thumbnails of the featured image for both. The page is:

    http://www.heavyartillery.com

    The blog post at the bottom do not show images. I have tried hacking around with the page template but I literally have no idea what I”m doing. Wondering if anyone could have a peek at the template code and tell me what I need to change?

    Any help is much appreciated.

    <?php
    /*
    Template Name: Homepage2
    */
    
    get_header(); ?>
    
    <div class="inner"> 
    
    <?php do_action('slideshow_deploy', '834'); ?> 
    
    	<?php
    	if(get_option_tree('slider_enable'))
    	{
    		include 'includes/slider.php';
    	}
    
    	$homepage_cc = get_option_tree('homepage_cc');
    
    	if($homepage_cc)
    	{
    		echo $homepage_cc;
    		echo '<div class="divider line"></div>';
    	}
    	?>    
    
        <?php homepage_tagline(); ?>
    
        <?php if(get_option_tree('recent_work')){  ?>
        <div id="recent-work" class="home-section">
            <h3><?php tr_translate('recent_work_title'); ?></h3>
            <?php $count = strtolower((str_replace (" ", "", get_option_tree('recent_work_st'))));
    			if($count == "fourcolumns"){
    				$query_count = 4;
    				$width = 198;
    				$height = 130;
    			}else{
    				$query_count = 3;
    				$width = 270;
    				$height = 190;
    			}
    		?>
            <ul class="<?php echo $count; ?>">
    
    			<?php query_posts('post_type=portfolio&posts_per_page='.$query_count); if 
    
    (have_posts()) : while (have_posts()) : the_post();	?>
                <li>
                    <a href="<?php the_permalink(); ?>" class="over">
                        <span><?php the_title(); ?></span>
                        <p><?php portfolio_desc_limited(); ?></p>
                    </a>
                    <a href="<?php the_permalink(); ?>"><img src="<?php post_thumb($width, $height); ?
    
    >" alt>   </a>
                </li>
                <?php endwhile; endif; wp_reset_query(); ?>                     
    
            </ul>
    
            <div class="clear"></div>
            <a href="<?php echo "?page_id=".get_option_tree('portfolio_page'); ?>" class="goto"><?php  
    
    tr_translate('recent_work_view'); ?></a>
        </div>    
    
        <div class="divider line"></div>
        <?php } ?> 
    
        <?php if(get_option_tree('recent_posts')){  ?>
        <div id="recent-posts" class="home-section">
            <h3><?php tr_translate('recent_posts_title'); ?></h3>
            <?php $count = strtolower((str_replace (" ", "", get_option_tree('recent_posts_st'))));
    			if($count == "fourcolumns"){
    				$query_count = 4;
    				$width = 198;
    				$height = 130;
    			}else{
    				$query_count = 3;
    				$width = 270;
    				$height = 190;
    			}
    		?>
            <ul class="<?php echo $count; ?>">
    
    			<?php query_posts('posts_per_page='.$query_count); if (have_posts()) : 
    
    while (have_posts()) : the_post();	?>
                <li>
                    <h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
                    <span class="post-info"><?php tr_translate(posted_by); ?> <strong><?php 
    
    the_author_posts_link(); ?></strong> <?php tr_translate(on); ?> <strong><?php the_time('M d, Y'); 
    
    ?></strong></span>
                    <?php the_excerpt(); ?>
                </li>
                <?php endwhile; endif; wp_reset_query(); ?>                    
    
            </ul>
    
            <div class="clear"></div>
            <a href="<?php blog_url(); ?>" class="goto"><?php tr_translate('recent_posts_view'); ?></a>
        </div>
    
        <div class="divider line"></div>
        <?php } ?>     
    
        <!--Begin Homepage Content-->
        <?php wp_reset_query(); if (have_posts()) : while (have_posts()) : the_post(); ?>
    
            <?php the_content(); ?>
    
        <?php endwhile; endif; ?>
        <!--End Homepage Content-->
    
    <?php get_footer(); ?>
  • The topic ‘Cannot get posts to display on homepage – any help?’ is closed to new replies.