Thanks for your reply,
I’ve taken the code I found from a rollover grid example and have it the way I want it (with test images, not pulling data from wordpress posts) and it works well.
I then registered a new image size in functions and tried to pull the new small squares into the grid code – and it didn’t work properly. It pulled the image through but at full size and there’s a broken image too.
Here’s the functions addition:
if ( function_exists( 'add_theme_support' ) ) {
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 625, 625, true ); // default Post Thumbnail dimensions (cropped)
add_image_size( 'the-hub-image', 625, 9999 ); //300 pixels wide (and unlimited height)
add_image_size( 'the-grid', 205, 205 );
}
– “the-grid” is the new image size (the thumbnail size is what we want to appear on the individual post page.
here’s the loop. I was just trying to bring the image through above the old loop (with the old loop still below the grid so I could bring parts in and delete others as I went) – dunno if this is part of the issue..
<div class="birdcage">
<img src="<?php if ( has_post_thumbnail()) : ?>
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php the_post_thumbnail( 'the-grid' ); ?>
</a>
<?php endif; ?>" />
<img class="top" src="../wp-content/themes/TheHubPR/images/grid_cover.png" />
<div class="text">Test</div>
</div>
<div class="birdcage">
<img src="../wp-content/themes/TheHubPR/images/temp_grid_box.jpg" />
<img class="top" src="../wp-content/themes/TheHubPR/images/grid_cover.png" />
<div class="text">Test</div>
</div>
<div class="birdcage">
<img src="../wp-content/themes/TheHubPR/images/temp_grid_box.jpg" />
<img class="top" src="../wp-content/themes/TheHubPR/images/grid_cover.png" />
<div class="text">Test</div>
</div>
<div class="birdcage">
<img src="../wp-content/themes/TheHubPR/images/temp_grid_box.jpg" />
<img class="top" src="../wp-content/themes/TheHubPR/images/grid_cover.png" />
<div class="text">Test</div>
</div>
<?php
if (have_posts()): ?>
<ol id="posts"><?php
while (have_posts()) : the_post(); ?>
<li class="postWrapper" id="post-<?php the_ID(); ?>">
<h2 class="postTitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
<div class="blog-box">
<?php the_post_thumbnail('the-hub-image', array('class' => 'alignleft')); ?>
<div class="post-pad"><div class="post"><?php the_content(__('(more...)')); ?></div>
<small><?php the_date(); ?></small>
<p class="postMeta">Category: <?php the_category(', ') . " " . the_tags(__('Tags: '), ', ', ' | ') ?> | <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)') ) . edit_post_link(__('Edit'), ' | '); ?></p>
</div></div>
</li>
<?php comments_template(); // Get wp-comments.php template ?>
<?php endwhile; ?>
</ol>
<?php else: ?>
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
<?php
endif;
?>
<?php if (will_paginate()): ?>
<ul id="pagination">
<li class="previous"><?php posts_nav_link('','','« Previous Entries') ?></li>
<li class="future"><?php posts_nav_link('','Next Entries »','') ?></li>
</ul>
<?php endif; ?>
Here’s the CSS, for posterity:
.birdcage {
background:#f00;
float:left;
position:relative;
width:205px;
height:205px;
margin-right: 5px;
margin-bottom: 5px;
}
.top {
position:absolute;
top:0;
left:0;
visibility:hidden;
}
.birdcage:hover .top {
/* z-index:-1; /* use this */
visibility:visible; /* or this */
/* left:-9999px; /* or this */
}
.text {
color:#fff;
padding: 5px;
position: absolute;
top: 90px;
width: 195px;
text-align: center;
}
If I can provide more info, I’d be happy to – thanks for your help again.
Best
MC