CPT List Column Issue
-
*disclaimer, I am a novice*
I have a page that lists the titles of a particular CPT in two columns and everything was fine until last week when the two columns became divided, instead of on parallel rows. I tried wrapping the columns and that didn’t work, and couldn’t find a solution online.
page of issue (scroll down to see): https://www.bosepublicaffairs.com/clients/
Any suggestions on where the code is messed up (see below)?
`<section class=”all-clients centered-container”>
<div class=”centered-content”>
<p style=”font-size: 16px; text-align: left;”><strong>Bose Public Affairs Group Full Client List</strong></p>
<a name=”clients-list” title=”list of all clients for Bose Public Affairs Group”></a>
<?php $query = new WP_Query(array ( ‘posts_per_page’ => ‘-1′,’post_type’ => ‘client’, ‘orderby’=>’title’, ‘order’ =>’ASC’ ));
if($query->have_posts()): $totalPosts = $query->post_count; $currentPost = 0; $halfPosts = $totalPosts/2; ?>
<div class=”clients-left”>
<ul>
<?php while ($query->have_posts()) : $query->the_post(); ?>
<?php if($currentPost <= $halfPosts) : ?>
<?php if(get_field(‘show_case_study_information’)) : ?>
<li><a href=”<?php the_permalink(); ?>” title=”Learn more about <?php the_title(); ?>”><?php the_title(); ?></a></li>
<?php else: ?>
<li><?php the_title(); ?></li>
<?php endif; ?>
<?php else: ?>
<?php endif; ?>
<?php $currentPost++; ?>
<?php endwhile; ?>
</ul>
</div>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
<?php $query = new WP_Query(array ( ‘posts_per_page’ => ‘-1′,’post_type’ => ‘client’, ‘orderby’=>’title’, ‘order’ =>’ASC’ ));
if($query->have_posts()): $totalPosts = $query->post_count; $currentPost = 0; $halfPosts = $totalPosts/2; ?>
<div class=”clients-right”>
<ul><?php while ($query->have_posts()) : $query->the_post(); ?>
<?php if($currentPost > $halfPosts) : ?>
<?php if(get_field(‘show_case_study_information’)) : ?>
<li><a href=”<?php the_permalink(); ?>” title=”Learn more about <?php the_title(); ?>”><?php the_title(); ?></a></li>
<?php else: ?>
<li><?php the_title(); ?></li>
<?php endif; ?>
<?php else: ?>
<?php endif; ?>
<?php $currentPost++;?>
<?php endwhile; ?>
</ul></div>
<?php endif; ?><?php wp_reset_postdata(); ?>
</div>
</div>
</sections>`
- The topic ‘CPT List Column Issue’ is closed to new replies.