Wondering if someone could take a look at my code here.

Hello,

Wondering if someone could take a look at my code here. I am using isotope for my portfolio filtering. I just noticed that for whatever reason any item that is tagged with multiple items will not show in when you click on the filter. So example, I have an <aside> element with the class of "hvac", so if I click on the hvac (or all) filter this item shows up. But if I have an <aside> element with a class of "hvac contractor" it will not show up in any filtering except the "all" section. I have tried many variations to try and fix this but no luck yet.

Code: Javascript

<script>

				jQuery(window).on('resize ajaxComplete', function() {
				    jQuery('.flexslider').flexslider({
				        namespace: "flex-",
				        animation: 'fade',
				        slideshow: true,
				        pauseOnHover: true,
				        keyboard: true,
				        initDelay: 0,
				        touch: true,
				        slideshowSpeed: 6000
				    });

				// Work Page - Smooth Filtering
				  var $container = jQuery('.work_items');

				  $container.isotope({
				  	itemSelector : '.work_item',
					  animationOptions: {
					     duration: 750,
					     easing: 'linear',
					     queue: false
					   }
				  });

				  var $optionSets = jQuery('#work_nav .filter_nav'),
				      $optionLinks = $optionSets.find('a');

				  $optionLinks.click(function(){
				    var $this = jQuery(this);
				    // don't proceed if already selected
				    if ( $this.hasClass('selected') ) {
				      return false;
				    }
				    var $optionSet = $this.parents('.filter_nav');
				    $optionSet.find('.selected').removeClass('selected');
				    $this.addClass('selected');

				    // make option object dynamically, i.e. { filter: '.my-filter-class' }
				    var options = {},
				        key = $optionSet.attr('data-option-key'),
				        value = $this.attr('data-option-value');
				    // parse 'false' as false boolean
				    value = value === 'false' ? false : value;
				    options[ key ] = value;
				    if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) {
				      // changes in layout modes need extra logic
				      changeLayoutMode( $this, options )
				    } else {
				      // otherwise, apply new options
				      $container.isotope( options );
				    }
				    return false;
				    });

				  // Call infinite scroll
				  $container.infinitescroll({
				        navSelector  : '.page-numbers',    // selector for the paged navigation
				        nextSelector : '.next',  // selector for the NEXT link (to page 2)
				        itemSelector : '.work_item',     // selector for all items you'll retrieve
						animate: true,
						loadingText  : "Loading more GDS Clients...",
				        loading: {
				            finishedMsg: 'No projects to load.',
				            img: '<?php bloginfo('url'); ?>/main/wp-content/uploads/2013/06/ajax-loader.gif'
				          }
				        },

				        // call Isotope as a callback
				        function( newElements ) {
				          $container.isotope( 'appended', jQuery( newElements ) );
				   });

				});

			   jQuery(document).ready(function($){
			      $('.lightbox').lightbox([ {
			      	title  : "<?php the_title(); ?>"
			      }
			      ]);
			    });
            </script>

Code: Filter

<ul class="filter_nav work_tags_nav option-set" data-option-key="filter">
					<li class="all"><a href="#filter" data-option-value="*" class="all selected">all.</a></li>
					<li class="business_technology"><a data-option-value=".business_technology" href="#filter">business & technology.</a></li>
					<li class="contractors"><a data-option-value=".contractors" href="#filter">contractors.</a></li>
					<li class="medical_health"><a data-option-value=".medical_health" href="#filter">medical & health.</a></li>
					<li class="retro"><a data-option-value=".retro" href="#filter">retro.</a></li>
					<li class="hvac"><a data-option-value=".hvac" href="#filter">hvac.</a></li>
					<li class="retail"><a data-option-value=".retail" href="#filter">retail.</a></li>
					<li class="education"><a data-option-value=".education" href="#filter">education.</a></li>
					<li class="non_profit"><a data-option-value=".non_profit" href="#filter">non-profit.</a></li>
					<li class="favorites"><a data-option-value=".favorites" href="#filter">favorites.</a></li>
				</ul>

Code: Elements to be filtered

<?php
	$args = array(
		'post_type' => 'attachment',
		'posts_per_page' => -1,
		'post_status' => 'any',
		'post_parent' => null,
		'tax_query' => array(
			array(
				'taxonomy' => 'post_tag',
				'field' => 'slug',
				'terms' => 'digital-interactive'
			)
		)
	);

$images = get_posts( $args );
if ( $images ) {
    foreach ( $images as $image ) {
        // Get the parent post ID
        $parent_id = $image->post_parent;
        // Get the parent post Title
        $parent_title = get_the_title( $parent_id );
        // Get the parent post permalink
        $parent_permalink = get_permalink( $parent_id );
        // Get image caption
        $logoimg = wp_get_attachment_image( $image->ID, 'Work Gallery' );

		$t = wp_get_post_tags($parent_id);
			$slugs = array();
			foreach($t as $slug) {
				array_push($slugs, $slug->name);
			}
			//$slugs = implode(', ', $slugs); // this would comma separate each term in the data-type
			$slugs = implode(' &nbsp;', $slugs); // this will separate each term with a space
			$slugs = str_replace(array('-', '&', ' '), array('_', '_'), $slugs);			

			echo '<aside class="work_item ' . $slugs . '" data-id="id-' . $parent_id . '">';				

				echo "<ul class='grid cs-style-3'>"; // grid style 3

					echo '<li>';

					echo '<figure>'; // figure

						echo '<div class="img_wrap">';

							echo $logoimg;

						echo '</div>';

						echo '<figcaption>'; // figurecaption

						echo '<ul class="work_meta">';

							echo '<li class="work_title">';

								echo ' ' . $parent_title . ' ';

							echo '</li>';

							echo '<li class="work_item_content">';

								echo gds_get_excerpt($image->ID);								

							echo '</li>';

							echo '<li class="work_item_content">';

								echo '<span>';
									echo '<a href="' . get_field('attachment_website', $image->ID) .  '" target="_blank">View Website</a>';
								echo '</span>';

							echo '</li>';

						echo '</ul>';

						echo '</figcaption>';

						echo '<ul class="work_features">';

							echo '<li class="lightbox">';

								$attachment_id = $image->ID;
								$attachment = get_post( $attachment_id );
								$image_title = $attachment->post_title;
								$image_alt = get_post_meta($attachment->ID, '_wp_attachment_image_alt', true);
								$src = wp_get_attachment_image_src( $image->ID, 'full' );
								$src = $src[0]; // Grabs only the URL ($src[1] = width of image, $src[2] = height of image)

								echo '<a data-title="' . $parent_title . " - " . $attachment->post_content . '" class="tooltip lightbox" data-rel="gal[2]" data-id="' . get_the_ID() . '" title="view in lightbox" href="' . $src . '?lightbox" rel="' . $image_alt . '">';

									echo 'Lightbox';

								echo '</a>';

							echo '</li>';

						echo '</ul>';

					echo '</figure>';

					echo '</li>';

				echo '</ul>';

			echo '</aside>';

		}
		wp_reset_postdata();
	}
?>

Any help would be greatly appreciated! Thank you!