Skip to main content

If you have a single page already, you should'tshouldn't be using a wp_query as well.

insteadInstead of these lines:

<?php $args = array( 'post_type' => 'listing');
$loop = new WP_Query( $args );
   while ( $loop->have_posts() ) : $loop->the_post(); ?>

useUse these lines:

    <?php
    // Start the loop.
    while ( have_posts() ) : the_post(); ?>

If you have a single page already, you should't be using a wp_query as well.

instead of these lines:

<?php $args = array( 'post_type' => 'listing');
$loop = new WP_Query( $args );
   while ( $loop->have_posts() ) : $loop->the_post(); ?>

use these lines:

    <?php
    // Start the loop.
    while ( have_posts() ) : the_post(); ?>

If you have a single page already, you shouldn't be using a wp_query as well.

Instead of these lines:

<?php $args = array('post_type' => 'listing');
$loop = new WP_Query( $args );
while ( $loop->have_posts() ) : $loop->the_post(); ?>

Use these lines:

<?php
// Start the loop.
while ( have_posts() ) : the_post(); ?>
Source Link
rudtek
  • 6.3k
  • 5
  • 30
  • 52

If you have a single page already, you should't be using a wp_query as well.

instead of these lines:

<?php $args = array( 'post_type' => 'listing');
$loop = new WP_Query( $args );
   while ( $loop->have_posts() ) : $loop->the_post(); ?>

use these lines:

    <?php
    // Start the loop.
    while ( have_posts() ) : the_post(); ?>