Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter nevewers

    (@nevewers)

    I got the headers to show but the post content isn’t showing, can you look at the code and tell me what else I could try?

    <?php
    get_header();
    ?>
    </div>
    <div class="gal_1">
     <?php
     $query1 = new WP_Query( 'category_name=1&showposts=1' );
    
    // The Loop
    while ( $query1->have_posts() ) {
            $query1->the_post();
    }
    
    wp_reset_postdata(); 
    
    ?>
    </div>
    <div class="strip"></div>
    <div class="content">
    	<?php
    	$query2 = new WP_Query( 'category_name=2&showposts=1' );
    
    // The 2nd Loop
    while( $query2->have_posts() ) {
            $query2->next_post();
            echo '<h2>' . get_the_title( $query2->post->ID ) . '</h2>';
    }
    
    wp_reset_postdata(); ?>
    </div>
    <div class="strip"></div>
    <div class="hero"><img src="img/hero.jpg" width="100%" height="651" alt=""></div>
    <div class="strip"></div>
    <div class="container_w content_2">
    	<?php
    		$query3 = new WP_Query( 'category_name=3&showposts=1' );
    
    // The 3rd Loop
    while( $query3->have_posts() ) {
            $query3->next_post();
            echo '<h1>' . get_the_title( $query3->post->ID ) . '</h1>';
    }
    
    wp_reset_postdata(); ?></div>
    <?php get_footer(); ?>
    Thread Starter nevewers

    (@nevewers)

    I suppose the best way to explain is I need multiple loops on the same for individual posts.

    So on Index.php i need 3 different ppost to show in 3 different areas of the page

Viewing 2 replies - 1 through 2 (of 2 total)