Weird behavior in php. Zoombox works in All category but not in specific ones
<p>I have a portfolio that uses some type of zoombox/ lightbox.  When Showing All categories it works fine, but when showing specific categories the  image no longer appear in the zoombox but rather opens up in the browser window. </p>

<p>I've been trying to fix the code to no avail. </p>

<p>Any help is greatly appreciated. Thx</p>

<p>website:  pes-chi-era.com/portfolio</p>

<p>Here is the php code for that portfolio- </p>

<pre><code>&lt;?php
/**
 * Template Name: Portfolio3
 *
 * A custom page template without sidebar.
 *
 * The "Template Name:" bit above allows this to be selectable
 * from a dropdown menu on the edit page screen.
 *
 * @package WordPress
 * @subpackage Starkers
 * @since Starkers 3.0
 */



get_header(); ?&gt;


&lt;script type="text/javascript" src="&lt;?php bloginfo('template_url'); ?&gt;/style/js/quicksand.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="&lt;?php bloginfo('template_url'); ?&gt;/style/js/jquery.easing.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="&lt;?php bloginfo('template_url'); ?&gt;/style/js/portfolio.js"&gt;&lt;/script&gt;

&lt;!-- Begin Container --&gt;
&lt;div id="container" class="quicksand"&gt;
&lt;!-- Begin Page Intro --&gt;

&lt;?php
/**
 * Template Name: Portfolio3
 *
 * A custom page template without sidebar.
 *
 * The "Template Name:" bit above allows this to be selectable
 * from a dropdown menu on the edit page screen.
 *
 * @package WordPress
 * @subpackage Starkers
 * @since Starkers 3.0
 */



get_header(); ?&gt;


&lt;script type="text/javascript" src="&lt;?php bloginfo('template_url'); ?&gt;/style/js/quicksand.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="&lt;?php bloginfo('template_url'); ?&gt;/style/js/jquery.easing.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="&lt;?php bloginfo('template_url'); ?&gt;/style/js/portfolio.js"&gt;&lt;/script&gt;

&lt;!-- Begin Container --&gt;
&lt;div id="container" class="quicksand"&gt;
&lt;!-- Begin Page Intro --&gt;

&lt;?php
    $intro = get_post_meta($post-&gt;ID, 'intro', true); 

    if ($intro) {
        echo "&lt;h3 class='intro'&gt;$intro&lt;span&gt;&lt;/span&gt;&lt;/h3&gt;";
    }
?&gt;
&lt;!-- End Page Intro --&gt;
&lt;ul class="gallerynav"&gt;
      &lt;li&gt;Show:&lt;/li&gt;
      &lt;li class="selected-1"&gt;&lt;a href="#" data-value="all" class="button2"&gt;All&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;?php 
      $pcat = get_option('of_portfolio_category');
$pcatid = get_cat_id($pcat);
  $categories=  get_categories('child_of='.$pcatid.'&amp;orderby=id'); 
  foreach ($categories as $cat) {
    $input = '&lt;li&gt;&lt;a href="#" data-value="category-'.$cat-&gt;category_nicename.'" class="button2"&gt;';
    $input .= $cat-&gt;cat_name;
    $input .= '&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;';
    echo $input;

  }
 ?&gt;
    &lt;/ul&gt;
    &lt;div class="clearfix"&gt;&lt;/div&gt;
&lt;ul id="gallery" class="grid"&gt;
&lt;?php $recent = new WP_Query(); ?&gt;
&lt;?php $recent-&gt;query('showposts=99999&amp;orderby=date&amp;order=desc'); ?&gt;
&lt;?php while($recent-&gt;have_posts()) : $recent-&gt;the_post(); ?&gt;
 &lt;?php $image_url = wp_get_attachment_url( get_post_thumbnail_id($post-&gt;ID) ); ?&gt;

&lt;?php if ( in_category($pcatid) ) {?&gt;
          &lt;!-- Begin Image --&gt;
    &lt;li data-id="&lt;?php echo "post-".get_the_id();?&gt;" &lt;?php post_class() ?&gt;&gt; 

      &lt;!-- Begin Full Size Link and Description --&gt; 
      &lt;!-- Begin conditional check for video --&gt;
    &lt;?php 
    $main_video=get_post_meta($post-&gt;ID, 'main_video', true); 
    $main_music=get_post_meta($post-&gt;ID, 'main_music', true);
    ?&gt;

    &lt;?php if ( $main_video ) : ?&gt;
    &lt;a rel="zoombox[portfolio]" href="&lt;?php echo get_post_meta($post-&gt;ID, "main_video", $single = true); ?&gt;" alt="&lt;?php the_title(); ?&gt;" class="play2"&gt;&lt;?php the_post_thumbnail( 'fade_thumbnail_bigger' ); ?&gt; &lt;/a&gt;


    &lt;?php elseif ( $main_music ) : ?&gt;


    &lt;a rel="zoombox[portfolio]" href="&lt;?php echo get_post_meta($post-&gt;ID, "main_music", $single = true); ?&gt;" alt="&lt;?php the_title(); ?&gt;" class="play2"&gt;&lt;?php the_post_thumbnail( 'fade_thumbnail_bigger' ); ?&gt; &lt;/a&gt;


    &lt;?php else : ?&gt;

    &lt;a href="&lt;?php echo $image_url;?&gt;" alt="&lt;?php the_title(); ?&gt;" class="zoom2"&gt;&lt;?php the_post_thumbnail( 'fade_thumbnail_bigger' ); ?&gt;&lt;/a&gt;
    &lt;?php endif; ?&gt;
&lt;!--End conditional check for video --&gt; 
      &lt;!-- End Full Size Link and Description --&gt;
      &lt;h4&gt;&lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;&lt;?php the_title_shorten(26,'...'); ?&gt;&lt;/a&gt;&lt;/h4&gt;
     &lt;p&gt;  &lt;?php echo cutMeAgain(get_the_excerpt()); ?&gt;&lt;/p&gt;

      &lt;a href="&lt;?php the_permalink(); ?&gt;" class="more"&gt;Read More&lt;/a&gt;  &lt;/li&gt;

    &lt;!-- End Image --&gt; 
    &lt;?php
        $otherson = get_post_meta($post-&gt;ID, 'others', false); 

        if ($otherson) { ?&gt;

    &lt;div class="hiddenothers"&gt;
    &lt;?php $others = get_post_meta($post-&gt;ID, 'others', false); ?&gt;


                &lt;?php foreach($others as $other) { ?&gt;
                 &lt;a href="&lt;?php echo ''.$other.'' ?&gt;" alt="&lt;?php the_title(); ?&gt;"&gt;&lt;/a&gt;         
                &lt;?php }?&gt;

    &lt;/div&gt;


        &lt;?php } ?&gt;
      &lt;?php }?&gt;
            &lt;?php  endwhile; ?&gt;
&lt;/ul&gt;
&lt;div class="clearfix"&gt;&lt;/div&gt;
&lt;!-- End Container --&gt;

&lt;/div&gt;
&lt;?php get_footer(); ?&gt;
</code></pre>
