Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter gregoryrich

    (@gregoryrich)

    I’ve figured out a way to get the thumbnails to link to the post pages, but now I have a new problem. My homepage is a static page which displays a grid of all my posts, and I have created a separate template for the actual posts, but it’s not taking. Every single page is using the same template as my static page, despite the fact that I’ve already applied the template to my posts page, and the post page template has a completely different loop than my static page.

    My homepage: http://www.gregoryrich.com

    Homepage loop:

    <div id="content" class="group">
    
    	<div id="gridcontainer">
    	<?php
    	$counter = 1; //start counter
    
    	$grids = 2; //Grids per row
    
    	global $query_string; //Need this to make pagination work
    
    	/*Setting up our custom query (In here we are setting it to show 12 posts per page and eliminate all sticky posts) */
    	query_posts($query_string . '&caller_get_posts=1&posts_per_page=12');
    
    	if(have_posts()) :  while(have_posts()) :  the_post();
    	?>
    	<?php
    	//Show the left hand side column
    	if($counter == 1) :
    	?>
    	            <div class="griditemleft">
    	                <div class="postimage">
    	                    <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('category-thumbnail'); ?></a>
    	                </div>
    	                <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
    	            </div>
    	<?php
    	//Show the right hand side column
    	elseif($counter == $grids) :
    	?>
    	<div class="griditemright">
    	                <div class="postimage">
                        <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_post_thumbnail('category-thumbnail'); ?></a>
    	                </div>
    	                <h3><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
    </div>
    	<div class="clear"></div>
    	<?php
    	$counter = 0;
    	endif;
    	?>
    	<?php
    	$counter++;
    	endwhile;
    	//Pagination can go here if you want it.
    	endif;
    	?>

    My posts page: http://www.gregoryrich.com/blog

    Posts loop:

    <?php
    // the query
    $the_query = new WP_Query( $args ); ?>
    
    <?php if ( $the_query->have_posts() ) : ?>
    
      <!-- pagination here -->
    
      <!-- the loop -->
      <?php while ( $the_query->have_posts() ) : $the_query->the_post(); ?>
        <h2><?php the_title(); ?></h2>
      <?php endwhile; ?>
      <!-- end of the loop -->
    
      <!-- pagination here -->
    
      <?php wp_reset_postdata(); ?>
    
    <?php else:  ?>
      <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p>
    <?php endif; ?>

    Any help is again of course really appreciated.

    Thread Starter gregoryrich

    (@gregoryrich)

    I wasn’t using z-index properly. Just realized, easy fix.

Viewing 2 replies - 1 through 2 (of 2 total)