Display only the first 4 images in an image gallery.
-
Ok so I m creating a portfolio site and on the category section I want to only display the Post thumb and the image gallery that is attached.
I am basing the design after this code:
https://nicholasiversonphotography.com/On the post I only want to display the first 4 images of the Gallery. When someone clicks into the the post they will be able to see the full gallery but I only want the first 4 to display on the category.php.
This is teh page I am working on.
https://spacedogcreative.com/category/portfolio/campaigns/Here is the code i am using. I have a conditional tag included.
<?php $images =& get_children( 'post_parent='.$id.'&post_type=attachment&post_mime_type=image' ); if( count($images) > 1 ) echo do_shortcode('[gallery option1="value1" columns="4" link="file"]'); ?>
HELP please!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Display only the first 4 images in an image gallery.’ is closed to new replies.