Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8666267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:41:08+00:00 2026-06-12T17:41:08+00:00

I am trying to display my custom post type in the theme I am

  • 0

I am trying to display my custom post type in the theme I am developing with the boostrap responsive framework. Everything is working great aside from the fact that I can’t get my custom post type to display correctly. I am looping through the post type and can’t end my <div>‘s resulting in the footer getting pushed to the left. Take a look:

<?php 
$query = new WP_Query(array('post_type'=>'services','posts_per_page'=>'5'));
while ($query->have_posts()) : $query->the_post();?>

<!-- Post Start -->
<div class="row">
<div class="span2">
<?php the_post_thumbnail(array(150,150), array('class'=>'service-image')); ?>
<h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
<?php the_title(); ?></h2></a>
<p><?php the_content(); ?></p>
<p><a class="btn" href="<?php the_permalink(); ?>">View details &raquo;</a></p>
</div>

<?php endwhile; wp_reset_query(); ?></div></div></div></div></div>
<!-- Post End -->

I have to stack my </div> at the end of the query in order for the custom post to display correctly and the footer returns to its proper spot. I am hoping that someone can see my error, because I am lost. Any help or guidance would be great. The theme can be seen in development at crothersenvironmental.com. On the live site I have removed all the ending div’s for troubleshooting purposes.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T17:41:09+00:00Added an answer on June 12, 2026 at 5:41 pm
    • As gArn said, your row div should be before the loop
    • you should not use <p> tag with the_content()
    • your </a> closing tag should be before </h2>

    You can try :

    <div class="row">
        <?php 
        $query = new WP_Query(array('post_type'=>'services','posts_per_page'=>'5'));
        while ($query->have_posts()) : $query->the_post(); ?>
    
        <!-- Post Start -->
        <div class="span2">
            <?php the_post_thumbnail(array(150,150), array('class'=>'service-image')); ?>
            <h2><a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">
            <?php the_title(); ?></a></h2>
            <div><?php the_content(); ?></div>
            <p><a class="btn" href="<?php the_permalink(); ?>">View details &raquo;</a></p>
        </div>
        <!-- Post End -->
    
        <?php endwhile; wp_reset_query(); ?>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to display results of a custom post type on my main
I'm trying to display a custom progressdialog while loading RSS feed from an HTTP
I want to display a list of post titles from a custom taxonomy in
Trying to display my custom post types for specific date ranges. I want to
I`m trying to display classes that have properties of type some custom class inside
I am trying to display a custom sheet in my application, but I think
(Magento Version 1.6) I'm trying to display a custom category attribute I created to
I am trying to have a tree display custom data that looks like this.
I'm trying to display a partial view using a custom helper method. The only
I am trying to get my Blackberry application to display a custom modal dialog,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.