Custom taxonomy template not working

First of all, a taxonomy-{taxonomy}.php file is an Archive Template and not a good name for a custom template. So if you want to proceed with a custom template, try naming the file with something like template-cities.php and call the file to a Page.

Otherwise, make a simple taxonomy-{taxonomy}.php archive template, and in your case taxonomy-city.php with code like:

<?php get_header(); ?>
<div id="page_content">
    <div class="page-wrapper">
        <div id="page_content_wrapper">
            <?php if (have_posts()) : ?>
                <div id="careers_table">
                    <?php while (have_posts()) : the_post(); ?>
                        <p class="content_text"><?php the_title(); ?></p>
                    <?php endwhile; ?>
                    <?php // pagination code here ?>
                </div>
            <?php else : ?>
                <div class="post">
                    <h3><?php _e('No City Found', 'cmeasytheme'); ?></h3>
                </div>
            <?php endif; ?>
        </div> <!-- .page_content_wrapper -->
        <div style="clear:both;"></div>
    </div> <!-- .page-wrapper -->
</div> <!-- .page_content -->
<?php get_footer(); ?>

And in this way, NO NEED to make any page and call a page template.

Suggestions

Though the suggestions are not related to WordPress, but related to Good practice:

  • Try naming you classes hyphen-separated (-), NOT underscore-separated (_). So class like page_content_wrapper would be page-content-wrapper.
  • Avoid inline styles, and make a class instead. So the clearing div <div style="clear:both;"></div> can be something like <div class="clearfix"></div> and you can place .clearfix{clear:both} in your external CSS file.
  • Use important commenting so that you can have trace of the closing divs etc.

Leave a Comment