How I fetched the data from different categories on same page

<?php

/*
Template Name: Success stories
*/


get_header(); ?>

	<div class="container" role="document">
		<div class="row row-new-sst">
			<?php get_sidebar(); ?>
	<!-- Row for main content area -->
		<div class="small-12 large-8 columns content-new-sst" id="content" role="main">
		<div class="sstories">
			<h1>Success Stories</h1>
			<p class="sstories-p">
				When you are coming to see an attorney, it is often a trying and stressful time in your life. At The Orlow Firm, we understand that intimately. Our goal is to serve all of our clients personally and compassionately and meet their needs after a traumatic incident by obtaining all compensation to which they may be entitled.

				Our firm’s significant verdicts and settlements show how we have helped many injured victims throughout New York City. You will see that we are dedicated to victims’ rights, justice and recovery.

				Our success is marked by more than numbers. Our client testimonials show the dignity, care and passion that we bring to helping our clients overcome serious injuries and accidents caused by the negligence or carelessness of others.</p>
			</div>
			
			<div class="sstories-cat"> 
				<h2> Construction and Maintenance Accidents </h2> 
			
			<?php
$loop5 = new WP_Query( array(
    'post_type' => 'success_stories',
	'cat' => '236',
	'category_name' => 'construction-and-maintenance-accidents',
    'posts_per_page' => -1
  )
);
?>
<div class="sstories-block">
<?php while ( $loop5->have_posts() ) : $loop5->the_post(); ?>

  			<div class="small-12 large-4 columns success-background-cell">
				<h1 class="entry-title-success"><?php the_title(); ?></h1>
				<div class="entry-content-success">
					<?php the_content(); ?>
				</div>
				
			</div>

<?php endwhile; wp_reset_query(); ?>
			</div>
				</div>
			
			<div class="sstories-cat">
				
				<h2>Premises Liability: Slip and Fall</h2>
		
			<?php /* Start loop for slip and fall category */ ?>
			
		<?php
$loop = new WP_Query( array(
    'post_type' => 'success_stories',
	'taxonomy' => 'category',
	'category_name' => 'slip-and-fall',
    'posts_per_page' => -1
  )
);
?>
<div class="sstories-block">
<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
  			<div class="small-12 large-4 columns success-background-cell">
				<h1 class="entry-title-success"><?php the_title(); ?></h1>
				<div class="entry-content-success">
					<?php the_content(); ?>
				</div>
			</div>
<?php endwhile; wp_reset_query(); ?>
</div>
			</div>
			
			
			<div class="sstories-cat"> 
				
				<h2>Premises Liability: Negligent Security and Supervision</h2>
			
			<?php
$loop1 = new WP_Query( array(
    'post_type' => 'success_stories',
	'category_name' => 'negligent-security-and-supervision',
    'posts_per_page' => -1
  )
);
?>
<div class="sstories-block">
<?php while ( $loop1->have_posts() ) : $loop1->the_post(); ?>

  			<div class="small-12 large-4 columns success-background-cell">
				<h1 class="entry-title-success"><?php the_title(); ?></h1>
				<div class="entry-content-success">
					<?php the_content(); ?>
				</div>
				
			</div>

<?php endwhile; wp_reset_query(); ?>
		</div>
			</div>
			
			<div class="sstories-cat"> 
				<h2>Premises Liability: Lead Poisoning</h2> 
			
			<?php
$loop2 = new WP_Query( array(
    'post_type' => 'success_stories',
	'cat' => '233',
	'category_name' => 'lead-poisoning',
    'posts_per_page' => -1
  )
);
?>

<div class="sstories-block">				
<?php while ( $loop2->have_posts() ) : $loop2->the_post(); ?>

  			<div class="small-12 large-4 columns success-background-cell">
				<h1 class="entry-title-success"><?php the_title(); ?></h1>
				<div class="entry-content-success">
					<?php the_content(); ?>
				</div>
				
			</div>

<?php endwhile; wp_reset_query(); ?>
			</div>
				</div>
			
			<div class="sstories-cat"> 
				
				<h2> Premises Liability: Sidewalk </h2> 
			
			<?php
$loop3 = new WP_Query( array(
    'post_type' => 'success_stories',
	'cat' => '234',
	'category_name' => 'sidewalk',
    'posts_per_page' => -1
  )
);
?>

				<div class="sstories-block"><div class="sstories-block">
<?php while ( $loop3->have_posts() ) : $loop3->the_post(); ?>

  			<div class="small-12 large-4 columns success-background-cell">
				<h1 class="entry-title-success"><?php the_title(); ?></h1>
				<div class="entry-content-success">
					<?php the_content(); ?>
				</div>
				
			</div>

<?php endwhile; wp_reset_query(); ?>
			</div>
					</div>
			
			
			<div class="sstories-cat"> 
				<h2> Premises Liability: Other </h2> 
			
			<?php
$loop4 = new WP_Query( array(
    'post_type' => 'success_stories',
	'cat' => '235',
	'category_name' => 'other',
    'posts_per_page' => -1
  )
);
?>
<div class="sstories-block">
<?php while ( $loop4->have_posts() ) : $loop4->the_post(); ?>

  			<div class="small-12 large-4 columns success-background-cell">
				<h1 class="entry-title-success"><?php the_title(); ?></h1>
				<div class="entry-content-success">
					<?php the_content(); ?>
				</div>
				
			</div>

<?php endwhile; wp_reset_query(); ?>
			</div>
				</div>
			
			
			<div class="sstories-cat"> 
				<h2> Motor Vehicle Accidents </h2> 
			
			<?php
$loop6 = new WP_Query( array(
    'post_type' => 'success_stories',
	'cat' => '237',
	'category_name' => 'motor-vehicle-accidents-3',
    'posts_per_page' => -1
  )
);
?>
<div class="sstories-block">
<?php while ( $loop6->have_posts() ) : $loop6->the_post(); ?>

  			<div class="small-12 large-4 columns success-background-cell">
				<h1 class="entry-title-success"><?php the_title(); ?></h1>
				<div class="entry-content-success">
					<?php the_content(); ?>
				</div>
				
			</div>

<?php endwhile; wp_reset_query(); ?>
			</div>
				</div>
			
			
			<div class="sstories-cat"> 
				<h2> Police Misconduct </h2> 
			
			<?php
$loop7 = new WP_Query( array(
    'post_type' => 'success_stories',
	'cat' => '238',
	'category_name' => 'police-misconduct-3',
    'posts_per_page' => -1
  )
);
?>
<div class="sstories-block">
<?php while ( $loop7->have_posts() ) : $loop7->the_post(); ?>

  			<div class="small-12 large-4 columns success-background-cell">
				<h1 class="entry-title-success"><?php the_title(); ?></h1>
				<div class="entry-content-success">
					<?php the_content(); ?>
				</div>
				
			</div>

<?php endwhile; wp_reset_query(); ?>
			</div>
				</div>
			
			
			
			<div class="sstories-cat"> 
				<h2> Foster Home Abuse </h2> 
			
			<?php
$loop8 = new WP_Query( array(
    'post_type' => 'success_stories',
	'tag_ID' => '239',
	'category_name' => 'foster-home-abuse',
    'posts_per_page' => -1
  )
);
?>
<div class="sstories-block">
<?php while ( $loop8->have_posts() ) : $loop8->the_post(); ?>

  			<div class="small-12 large-4 columns success-background-cell">
				<h1 class="entry-title-success"><?php the_title(); ?></h1>
				<div class="entry-content-success">
					<?php the_content(); ?>
				</div>
			</div>

<?php endwhile; wp_reset_query(); ?>
			</div>
				</div>
			
		</div>
		</div><!-- Row End -->

	</div><!-- Container End -->	
			
	<?php get_template_part('feature-testimonials'); ?>
	<?php get_template_part('feature-locations'); ?>

	<section id="static_map">
		<img src="/wp-content/uploads/2015/03/map3.png" alt="Static Map of Locations" class="show-for-medium-up">
	</section>
	<?php get_template_part('feature-cta'); ?>
</div>			
<?php get_footer(); ?>

Share it in your network:

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

small_c_popup.png

Congratulations!

You have successfully subscribed to my email list. Now you will be recieving latest wordpress tips and tricks directly in your mail box.

Don’t worry! I won’t spam you