• I have a page with an array and a bit lower on the page I’m calling <?php the_content(); ?>

    The content is showing the content of the first item on the array and not the page content.

    what can I do to show true page content instead of the array content?

    Here is my array:

    <?php
    $loop = new WP_Query(array('post_type' => 'project', 'posts_per_page' => -1, 'orderby' => 'rand'));
    $count =0;
    ?>
    
    <ul id="portfolio-list">
    
    <?php if ( $loop ) :
    while ( $loop->have_posts() ) : $loop->the_post(); ?>
    
    <?php
            $terms = get_the_terms( $post->ID, 'tagportifolio' );
    
            if ( $terms && ! is_wp_error( $terms ) ) :
            $links = array();
    
            foreach ( $terms as $term )
               	{
               	$links[] = $term->name;
               	}
               	$links = str_replace(' ', '-', $links);
               	$tax = join( " ", $links );
             else :
            $tax = '';
            endif;
    ?>
    
    <?php $infos = get_post_custom_values('_url'); ?>
    
    <li class="portfolio-item <?php echo strtolower($tax); ?> all">
    <div class="thumb"><a href="<?php the_permalink() ?>"><?php the_post_thumbnail('category-thumb'); ?></a></div>
    <h3><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h3>
    </li>
    
    <?php endwhile; else: ?>
    
     <li class="error-not-found">Sorry, no portfolio entries for while.</li>
    
    <?php endif; ?>

  • The topic ‘page with "new WP_Query(array" showing array data instead of content?’ is closed to new replies.