WP_Query Problem With Database
-
Hello,
Having the darnedest time trying to figure this out.
The Posts table has 5 posts that are setup with Post Type “Foundation”. Unfortunately, only 3 of them are being displayed. It is a very strange situation. The segment of code that is controlling this in the file home.php is and the area in question is the section with WP_Query.
<?php /* Template Name: Fron Page Layout */ get_header(); ?> <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> <div class="content-home"> <div class="box_main_page"> <div class="title"> <?php $custom = get_post_custom($post->ID); ?> <?php $slogan = (empty($custom['slogan'][0]) ? '' : $custom['slogan'][0]); ?> <h2><?php echo $slogan; ?></h2> </div> <?php $loop = new WP_Query(array( 'post_type' => 'foundation', 'orderby' => 'title', 'order' => 'ASC', 'numberposts' => 4 )); ?> <?php $column_classes = array('column_one', 'column_two', 'column_three', 'column_four'); ?> <?php if ($loop->have_posts()) while ($loop->have_posts()) : $loop->the_post(); ?> <div class="<?php echo current($column_classes); next($column_classes); ?>"> <span class="letter"><?php the_title(); ?></span> <div class="excerpt"><?php the_excerpt(); ?></div> <?php the_content(); ?> </div> <?php endwhile; ?> <div class="clear"></div> </div> <p> </p> <?php $loop = new WP_Query(array( 'post_type' => 'post', 'category_name' => 'selected', 'orderby' => 'post_date', 'order' => 'DESC', 'numberposts' => 5, 'posts_per_page' => 5 )); ?> <?php if ($loop->have_posts()) while ($loop->have_posts()) : $loop->the_post(); ?> <div class="post"> <div class="title"> <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2> </div> <p><?php the_post_thumbnail(); ?></p> <div class="post_short"><?php the_excerpt(); ?></div> </div> <?php endwhile; ?> </div> <?php endwhile; ?> <?php get_footer(); ?>Anyone have any thoughts as to what might be wrong here? It’s probably something silly, but I’ve spent hours trying to find it and I’m probably seeing double at this point.
Thanks for any feedback.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘WP_Query Problem With Database’ is closed to new replies.