• Hello all,

    I am using a jquery script to create a slideshow. I am using it in WordPress and with some customization it is working so far. I am not very good at PHP and I am having some trouble with arrays. I am wondering if there is a way to do the following things.
    Each slideshow needs a unique name. You can see where I’ve notated where I need the slideshow value appended to a “div#” so that each post has a unique slideshow div name.

    Secondly, I am manually entering the number of slides contained in the slideshow list. How can I grab the number that’s in that array and then use it to populate the results. This is what I have:

    • <img src=”<?php echo $src_featured_image3; ?>” width=”331″ height=”255″ />
    • I’m guessing it would need to be a short if then loop to see if there is a result and then pipe the result into a <?php echo $src_featured_image[a]; ?> kind of thing. The variables themselves are being entered in custom fields.

      I can expand if any of this is confusing.
      Thanks!
      I hope this code shows up correctly here….

      <script type="text/javascript">
      			$(window).bind("load", function() {
      			$("div#slideshow").slideView(); //this is where I want the array value
      		}); 
      
      	</script>
      
       <?php if (have_posts()) : while (have_posts()) : the_post();  ?>
         <div class="twoColFixLtHdr">
      
      				<?php
      						$project = get_post_meta($post->ID, "project_value", true);
      						$client = get_post_meta($post->ID, "client_value", true);
      	$slideshow = get_post_meta($post->ID, "slideshow_value", true);
      						$src_featured_image1 = get_post_meta($post->ID, "src_featured_image1_value", true);
      						$src_featured_image2 = get_post_meta($post->ID, "src_featured_image2_value", true);
      						$src_featured_image3 = get_post_meta($post->ID, "src_featured_image3_value", true);
      				?>
      
      	<div>
      		<div id="container">
       		 <div id="header">
      
         			 <h1><?php echo $project; ?></h1>
      			</div>
       <div id="<?php echo $slideshow; ?>"class="svw">
          <ul>
          	<li><img src="<?php echo $src_featured_image1; ?>" width="331" height="255" /></li>
          	<li><img src="<?php echo $src_featured_image2; ?>" width="331" height="255" /></li>
          	<li><img src="<?php echo $src_featured_image3; ?>" width="331" height="255" /></li>
          </ul>
      
        </div>
        <div id="mainContent">
          <p class="h2">
      
         		 <?php if($client !== '') {  ?>
      			<span class="style2">CLIENT</span>&nbsp;<?php echo $client; ?><br />
      						<?php } ?>
      		<?php if($company !== '') {  ?>
      			<span class="style2">COMPANY</span>&nbsp;<?php echo $company; ?><br />
      						<?php } ?>	
      
          <p class="entry"><?php the_content() ?>
      
        </div>
      </div>
  • The topic ‘PHP Question with jquery slideshow’ is closed to new replies.