Support » Fixing WordPress » Display two categories in separate loops on the same page.

  • Resolved frankjkeane

    (@frankjkeane)


    Hi, thanks for viewing. I want to show a schedule table which I am using a plugin to create and above the schedule table I want a post (category = updates) to display updates. Is it possible to display the two loops one page. The code I am using is returning ‘Sorry, no posts matched…’

    Many thanks

    <div class="schedule">
    			<div class="updates">
    				<h1>SCHEDULE</h1>
    				<?php $query = new WP_Query( 'updates' ); ?>
    					<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    					<div class="post-wrap">
    						<h2><?php the_title(); ?></h2>
    						<?php the_content(); ?>
    					</div> <!--post-wrap-->
    					<?php endwhile; else: ?>
    				<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    				<?php endif; ?>
    
    			</div> <!--updates-->
    			<p id="bookings">Book your place at <a href="http://www.yogadublin.com">www.yogadublin.com</a> or call me 087-7471127. All classes and workshops take place in Yoga Dublin Studios, Ranelagh.</p>
    			<div class="schedule-table">
    			<?php
    			$query = new WP_Query( 'schedule' );
    			while (have_posts()) : the_post();
    			the_content();
    			endwhile;
    			?>
    
    			</div> <!--schedule table-->
    		</div> <!--schedule-->
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Display two categories in separate loops on the same page.’ is closed to new replies.