I am trying to wrap my head around custom post types. What I am trying to achieve is a simple branch listing. There is a dealers menu that has drop downs with regions. When you click on a region I just want it to list branches within the region. Nothing fancy, no maps, just plain text with branch name and contact details + address. Something like this:

Branch Name
Contact Person
Contact number

Branch Name 2
Contact Person 2
Address 2
Contact number 2

I have used custom post UI plugin and another one that lets me add this data in the backend. I can't for the life of me figure out how to display it in the frontend.

I don't want it to act like a post where it lists everything and you click on it for more detail. It should just display as above when you click on a region from the dropdown. Is there a plugin that would do this or do you have to hard code it?

  • You have to make a custom post type archive in your theme like: archive-{$post-type}.php. That's all. It's the core thing. :) Dec 1, 2014 at 5:55
  • Did you create the CPT and custom fields using a plugin? Dec 1, 2014 at 8:44
  • Hi. Yes, I used a plugin. Custom Post UI I think it was
    – Iggy's Pop
    Dec 1, 2014 at 20:08

3 Answers 3


You can do that easy on this way, just duplicate single.php and rename to single-custom-post-type-name.php like single-cars.php, same thing with archive or taxonomy, taxonomy-taxonomy-name.php or archive-taxonomy-name.php

Or you can make your query for random page, home or blog:

// The Query
$query = new WP_Query(array('post_type' => 'your-custom-post'));
query_posts( $query );

// The Loop
while ( $query->have_posts() ) : $query->the_post();  
  // your post content ( title, excerpt, thumb....)

// Reset Query

Good luck! ;)

  • Thank you, I will give this a try in the next day or two. Thanks so much for your response.
    – Iggy's Pop
    Dec 1, 2014 at 20:09
?php while (have_posts()) : the_post(); ?>
    $args = array('post_type' => 'employee', 'posts_per_page' => 10);
    $the_query = new WP_Query($args);
    <?php if ($the_query->have_posts()) : ?>
      <?php while ($the_query->have_posts()) : $the_query->the_post();?>

        <?php endwhile;
        wp_reset_postdata(); ?>
    <?php else :  ?>
        <p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
    <?php endif; ?>
  • I'm not sure what's going on here: you have the main loop in the first and last lines, and you have a separate loop to output the same first 10 employees between every post in the main loop?
    – Rup
    Oct 13, 2021 at 9:31

Try It and Good Luck

$args = array(
    'post_type' => 'your custom post name',
    'post_status' => 'publish',
    'posts_per_page' => 10,
$arr_posts = new WP_Query( $args );

if ( $arr_posts->have_posts() ) :
while ( $arr_posts->have_posts() ) :
    echo the_title(); 

  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Oct 13, 2021 at 11:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.