Function listPost-Thumb provides three main functions to adapt your theme: - the_thumb(): displays post thumbnails. Loop function.
- the_recent_thumbs(): displays a list of most recent post thumbnails. Anywhere function.
- the_random_thumb(): displays a list of randomized post thumbnails. Anywhere function.
You can set the parameters in the option screen for the entire site, or change them locally in any function call your theme template may contain using function parameters. Using function parametersEach function can be used with numerous parameters to manage display or how or where thumbnails are saved. You do not have to use them unless you want different settings from the default options you have choosen in the option screen. Each parameter should be input with its value separated with '=' and separated from the other parameters with '&'. Example: <?php get_recent_thumbs("WIDTH=100&HEIGHT=80&ROUNDED=1&LIMIT=12"); ?>
Simple examplesAn entire loop: <?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="post">
<div class="entry">
<?php the_thumb('link=p&subfolder=loop&align=left&nodef&lb_effect=1'); ?>
<?php the_excerpt() ?>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
This will display the post thumbnails using default options. In addition, it will: - link the thumbnail to the post.
- save the thumbnails in the subdirectory named 'loop'.
- insert align left attribute in the img code.
- will not display default image if there is no image in the post.
- will add a popup effect to the thumbnail. In this case, the popup will open on the post.
A sidebar example: <?php echo get_recent_thumbs("altappend=first-&width=180&height=120&category=1&offset=0&limit=1"); ?>
<?php echo get_recent_thumbs("altappend=main-&width=50&height=50&category=1&offset=1&limit=6"); ?>First line will display the first (limit=1) post of category 1 with a size of 180x120. The save name will be: first-image.xxx. Second line will display the 6 (limit=6) following (offset=1) posts of category 1 with a size of 50x50. The save name will be: main-image.xxx.
|