WordPress.org

Ready to get started?Download WordPress

Forums

Custom Post Type UI
[resolved] taxonomy not displaying on front end (3 posts)

  1. pkp3
    Member
    Posted 9 months ago #

    I will try to explain this. I imported an older site that was using Custom Post Type UI into a new site that had the same taxonomy fields. The taxonomy fields imported correctly. I set up a single.php in my theme that has the follow

    `<?php $era_values = get_post_meta($post->ID, 'era', true ); ?>
    <li class="building-meta"><span class="building-meta-label">Era:</span> <span class="building-meta-values"><?php echo $era_values; ?></span>

    <?php $neighborhood_values = get_post_meta($post->ID, 'neighborhood', true ); ?>
    <li class="building-meta"><span class="building-meta-label">Neighborhood:</span> <span class="building-meta-values"><?php echo $neighborhood_values; ?></span>'

    These 2 fields show up on the front end from the older imported materials but any new content selections in those 2 taxonomies do not appear. They are appearing on the post editor page and I'm also using Query Multiple Taxonomies plugin and those newly selected taxonomies are displaying properly there. I've checked my theme code compared to the other taxonomy code on single.php and I can't see any difference. Do you have any suggestions?
    thanks Pam

    http://wordpress.org/plugins/custom-post-type-ui/

  2. pkp3
    Member
    Posted 9 months ago #

    Forgot to say that changing the taxonomy selection does not change the output on the older posts at all.

  3. Michael Beckwith
    Member
    Plugin Author

    Posted 9 months ago #

    I'm a little bit confused. You migrated the old CPTUI post types and whatnot to the new location and all that went well.

    You then have 2 places where you display html list items that echo post meta for Eras and Neighborhoods. After that, you start mentioning stuff about taxonomies, which are different than post meta.

    It sounds like your new posts aren't getting the same meta key/meta value pairings saved at all. This would be set with the "Custom fields" metabox in your post editor.

    However, if you're now using a taxonomy to assign terms to the posts, then you'll need to use something like get_the_terms() to fetch those and display in your template file. http://codex.wordpress.org/Function_Reference/get_the_terms. Another option, get_the_term_list() http://codex.wordpress.org/Function_Reference/get_the_term_list

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.