Support » Fixing WordPress » link my featured flex slider images to corresponding image

  • Hello all, I have been stuck on this one for a while and have no idea how to fix it, i have Flexslider plugin as my featured gallery formats, it displays all the attached images to the post as a slider, what i want to do is make it so it links every image to its corresponding image, so in the slider I can just click on the and view that specific image, what I have in my post format file “gallery.php”

    <?php //Get the Image attachment stuff
    $args = array(
    		'post_type' => 'attachment',
    		'numberposts' => null,
    		'post_status' => null,
    		'post_mime_type' => 'image',
    		'order'		  => 'ASC',
    		'post_parent' => $post->ID,
    		'posts_per_page'	=> '9999'
    $attachments = get_posts( $args ); ?>
    <!-- Start Post <?php the_ID(); ?> -->
    <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>	
    	<section class="type">
    		<i class="icon-camera"></i>
    	<section class="post-above">
    		<?php if(count( $attachments ) > 1) { ?>
    	 		<div class="flexslider">
    				<ul class="slides">
    					<?php foreach ( $attachments as $attachment ) { 	?>
    						<li><?php echo wp_get_attachment_image( $attachment->ID, 'cw-post' ); ?></li>
    						<?php } ?>
    		<?php } else {
    			foreach ( $attachments as $attachment ) { 	 ?>
    				<?php echo wp_get_attachment_image( $attachment->ID, 'cw-post' ); 
    		} ?>

    Any help would be greatly appreciated

  • The topic ‘link my featured flex slider images to corresponding image’ is closed to new replies.