php to display only one post in code
-
I am trying to list post images but in the code I want all post except the first on to be in their own <div style=”display:none;> so they are in the code but don’t display. I need to do this to get prettyphoto to work the way I want it.
<a rel="prettyPhoto[<?= $category->term_id; ?>]" title="<?php echo $post->post_title; ?>" href="<?php echo $img_large; ?>"> <?php $img = get_post_meta($post->ID, 'port_thumb_image_url', true); if(!empty($img)) { ?> <img src="<?php bloginfo('template_directory'); ?>/timthumb.php?src=<?php echo $img; ?>&h=220&w=280&zc=1&q=100&s=1" alt="<?php the_title(); ?>" /> <?php } ?> </a>
This is the code I want to show for the first post and wrapped in div for all others. Any help?
Thank you.
- The topic ‘php to display only one post in code’ is closed to new replies.