Slideshows
-
I added another pop-up slideshow called “Recently Completed” to the bottom right of this page http://www.norcalconstruction.com/.
This is a custom theme.
I just copied the code of the first slideshow “Project Spotlight” and pasted it in and changed the title.
My question is how do I change the images on the new one?
Any advice is appreciated.
Thanks
h20
Here’s the code…<?php /** * @package WordPress * @subpackage NorCal Construction */ $dir = 'wp-content/themes/NCConstruction/images/underConstruction/slideShows/'; ?> <div id="lower"> <div id="currentlyUnderConstruction"> <h3>PROJECT SPOTLIGHT</h3> <div id="currentProjectsCycle"> <?php $underConstruction = new WP_Query(); $underConstructionCatId = get_cat_ID('Currently Under Construction'); $underConstruction->query('cat='.$underConstructionCatId); $underConstructionPosts = array(); $noOrderValIndex = 0; /* creates indie loop limited to Currently Under Construction category */ ?> <?php while ($underConstruction->have_posts()) : $underConstruction->the_post(); ?> <?php $title = get_the_title( $post->ID ); $image = get_post_meta($post->ID, 'image', true); $location = get_post_meta($post->ID, 'location', true); $architect = get_post_meta($post->ID, 'architect', true); $UCdescription = get_post_meta($post->ID, 'UCdescription', true); $postOrder = get_post_meta($post->ID, 'postOrder', true); $thisPost = array('image'=>$image,'title'=>$title,'location'=>$location,'architect'=>$architect,'description'=>$UCdescription); // get custom order value if ( !empty($postOrder) ) { // if an order val is entered, use it to determine the post's place in the array $underConstructionPosts[ $postOrder - 1 ] = $thisPost; } else { // if no order val is present, put the post at the end of the array $underConstructionPosts[ $underConstruction->post_count + $noOrderValIndex ] = $thisPost; $noOrderValIndex++; } ?> <?php endwhile; ?> <?php ksort($underConstructionPosts); ?> <?php foreach( $underConstructionPosts as $val ) : ?> <?php $filename = str_replace(' ', '_', $val['title']); $filename = strtolower($filename); $fileName = $filename; $homeGroup = glob($dir.$filename.'/*.*'); $first = false; if($homeGroup and $homeGroup != array()) { $rel = 'homes-'.$fileName; foreach($homeGroup as $fileName){ if($first){ echo '<a style="display:none" class="thickbox" rel="'.$rel.'" title="' . substr(basename($fileName),0,-4) . '" href="/' . $fileName . '"></a>'; } else { $first = true; ?> <div class="currentProjectsInstance"> <? echo '<a style="display:block" class="thickbox" rel="'.$rel.'" title="' . substr(basename($fileName),0,-4) . '" href="/' . $fileName . '">'; echo ncCallImage('/images/underConstruction/' . $val['image'] ) . '</a>'; ?> <div class="text"> <p>Project Name:<br /><b><?php echo $val['title']; ?></b></p> <p>Address:<br /><?php echo $val['location']; ?></p> <p>Architect:<br /><?php echo $val['architect']; ?></p> <p>Description:<br /><?php echo $val['description']; ?></p><? } } }?> <?php endforeach; ?> </div><!--//text--> </div><!--//currentProjectsInstance--> </div><!--//currentProjectsCycle--> </div><!--//currentlyUnderConstruction--> </div> <div id="lower2"> <div id="currentlyUnderConstruction2"> <h3>RECENTLY COMPLETED</h3> <div id="currentProjectsCycle2"> <?php $underConstruction = new WP_Query(); $underConstructionCatId = get_cat_ID('Currently Under Construction'); $underConstruction->query('cat='.$underConstructionCatId); $underConstructionPosts = array(); $noOrderValIndex = 0; /* creates indie loop limited to Currently Under Construction category */ ?> <?php while ($underConstruction->have_posts()) : $underConstruction->the_post(); ?> <?php $title = get_the_title( $post->ID ); $image = get_post_meta($post->ID, 'image', true); $location = get_post_meta($post->ID, 'location', true); $architect = get_post_meta($post->ID, 'architect', true); $UCdescription = get_post_meta($post->ID, 'UCdescription', true); $postOrder = get_post_meta($post->ID, 'postOrder', true); $thisPost = array('image'=>$image,'title'=>$title,'location'=>$location,'architect'=>$architect,'description'=>$UCdescription); // get custom order value if ( !empty($postOrder) ) { // if an order val is entered, use it to determine the post's place in the array $underConstructionPosts[ $postOrder - 1 ] = $thisPost; } else { // if no order val is present, put the post at the end of the array $underConstructionPosts[ $underConstruction->post_count + $noOrderValIndex ] = $thisPost; $noOrderValIndex++; } ?> <?php endwhile; ?> <?php ksort($underConstructionPosts); ?> <?php foreach( $underConstructionPosts as $val ) : ?> <?php $filename = str_replace(' ', '_', $val['title']); $filename = strtolower($filename); $fileName = $filename; $homeGroup = glob($dir.$filename.'/*.*'); $first = false; if($homeGroup and $homeGroup != array()) { $rel = 'homes-'.$fileName; foreach($homeGroup as $fileName){ if($first){ echo '<a style="display:none" class="thickbox" rel="'.$rel.'" title="' . substr(basename($fileName),0,-4) . '" href="/' . $fileName . '"></a>'; } else { $first = true; ?> <div class="currentProjectsInstance"> <? echo '<a style="display:block" class="thickbox" rel="'.$rel.'" title="' . substr(basename($fileName),0,-4) . '" href="/' . $fileName . '">'; echo ncCallImage('/images/underConstruction/' . $val['image'] ) . '</a>'; ?> <div class="text"> <p>Project Name:<br /> <b><?php echo $val['title']; ?></b></p> <p>Address:<br /> <?php echo $val['location']; ?></p> <p>Architect:<br /> <?php echo $val['architect']; ?></p> <p>Description:<br /> <?php echo $val['description']; ?></p> <? } } }?> <?php endforeach; ?> </div> <!--//text--> </div> <!--//currentProjectsInstance--> </div> <!--//currentProjectsCycle--> </div> <!--//currentlyUnderConstruction--> <!--//testimonials--> </div> <p> </p> <!--//lower-->
- The topic ‘Slideshows’ is closed to new replies.