Hefemeister
Lord Techie,
- Messages
- 9,093
- Location
- Sweden
Ok total noob so go easy on me.
I have a template that will pull all images and put them into thumbs so they can be viewed in lightbox.
I am trying to edit it such that only pictures assigned to a specific category will be displayed.
Example:
I have a gallery page with all images using the above template. I want a sub page that will only display pictures in the kids category. I thought this would do it but to no avail.
Thanks everyone for their input.
I have a template that will pull all images and put them into thumbs so they can be viewed in lightbox.
Code:
<?php
/*
Template Name: mosaic
*/
?>
<?php get_header(); ?>
<div class="thumbwall_container">
<?php $temp_query = clone $wp_query; ?>
<?php query_posts('showposts=1734'); ?>
<?php while (have_posts()) : the_post();?>
<?php if (in_category('blog')) continue;
if ($images = get_children(array(
'post_parent' => $post->ID,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order')))
foreach($images as $image) {
$viso_image = $image->guid;
$viso_thumb = wp_get_attachment_thumb_url( $image->ID, $size);
if (current_user_can('level_2')) {} else { if (in_category('private'))
{$viso_thumb = site_url('/wp-content/themes/viso/images/private_extrasmall.png');
$viso_image = site_url('/wp-content/themes/viso/images/private_info.png');}}?>
<div class="thumbwall_box" style="background:url(<?php echo $viso_thumb; ?>) no-repeat center center; ">
<div class="thumbwall_box_link"><a href="<?php echo $viso_image; ?>" rel="lightbox[mset]" title="<?php the_title(); ?>"></a>
</div>
</div>
<?php } else { ?>
<div class="thumbwall_box" style="background:url(<?php bloginfo ('template_directory'); ?>/images/noimage.png) no-repeat center center; ">
<div class="thumbwall_box_link"><a href="<?php bloginfo ('template_directory'); ?>/images/noimage_big.png" rel="lightbox[mset]" title="<?php the_title(); ?>"></a>
</div>
</div>
<?php } ?>
<?php endwhile; ?>
<?php $wp_query = clone $temp_query; ?></div>
<div class="clear"></div>
</div>
<?php get_footer(); ?>
I am trying to edit it such that only pictures assigned to a specific category will be displayed.
Example:
I have a gallery page with all images using the above template. I want a sub page that will only display pictures in the kids category. I thought this would do it but to no avail.
Code:
<?php
/*
Template Name: kids
*/
?>
<?php get_header(); ?>
<div class="thumbwall_container">
<?php while (have_posts()) : the_post();?>
<?php if (in_category('blog')) continue;
if ($images = get_children(array(
'post_parent' => $post->ID,
'post_status' => 'inherit',
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'orderby' => 'menu_order')))
foreach($images as $image) {
$viso_image = $image->guid;
$viso_thumb = wp_get_attachment_thumb_url( $image->ID, $size);
if (current_user_can('level_2')) {} else { if (in_category('private'))
{$viso_thumb = site_url('/wp-content/themes/viso/images/private_extrasmall.png');
$viso_image = site_url('/wp-content/themes/viso/images/private_info.png');}}?>
<div class="thumbwall_box" style="background:url(<?php echo $viso_thumb; ?>) no-repeat center center; ">
<div class="thumbwall_box_link"><a href="<?php echo $viso_image; ?>" rel="lightbox[mset]" title="<?php the_title(); ?>"></a>
</div>
</div>
<?php } else { ?>
<div class="thumbwall_box" style="background:url(<?php bloginfo ('template_directory'); ?>/images/noimage.png) no-repeat center center; ">
<div class="thumbwall_box_link"><a href="<?php bloginfo ('template_directory'); ?>/images/noimage_big.png" rel="lightbox[mset]" title="<?php the_title(); ?>"></a>
</div>
</div>
<?php } ?>
<?php endwhile; ?>
</div>
<div class="clear"></div>
</div>
<?php get_footer(); ?>
Thanks everyone for their input.