Home>Support>Custom Post Type meta doesn’t display on single-post: Vantage Theme

Custom Post Type meta doesn’t display on single-post: Vantage Theme

By ICLEIUSA, 8 years ago. Last reply by Andrew Misplon, 8 years ago.

Hello –
I am trying to figure out why my custom taxonomies don’t appear on the single post of my CPT “Resources”. I am using the vantage theme, and the tags I copied form my “Posts” appear on the CPT only.

http://dev.californiaseec.org/resource/sample-1/

Any help on why this is?

thanks in advance!!

URL: http://dev.californiaseec.org/resource/sample-1/

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Hi ICLEIUSA

    Thanks for reaching out. Are you expecting your custom taxonomy to be listed in the bottom post meta “Posted in and tagged in”? If so, I wouldn’t imagine they would show there. The category list uses:

    https://codex.wordpress.org/Function_Reference/get_the_category_list

  2. 8 years, 11 months ago ICLEIUSA

    Ah I see, thank you..

    Do you know if there is a way to get custom Taxonomies recognized as a post_id? Or just listed in the “Posted in…” section

  3. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    There is, unfortunately, no easy way without heading down the custom development route. Perhaps consider using a sidebar widget:

    https://wordpress.org/plugins/search.php?type=term&q=custom+taxonomies+widget

    You could add Jetpack Widget Visibility to choose when to display the widget:

    http://jetpack.me/support/widget-visibility/

  4. 8 years, 11 months ago ICLEIUSA

    Thank you, we are trying to limit our use of plugins.. but are somewhat familiar with php and not averse to custom development. If you have any resources you are aware of the help me go down that route I would appreciate it!

    In the meantime I will keep looking myself.

    thanks

  5. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    In that case you should be able to sort this out. You’ll need to work from within a child theme. Here is a starter child theme for Vantage:

    https://siteorigin.com/wp-content/uploads/2015/03/vantage-child-starter.zip

    Download the ZIP and install from Appearance > Themes > Add New: Upload.
    Menu location assignments will reset as a result, just re-save.

    We need to work in a child theme as all WordPress.org themes overwrite during theme updates.

    If you check content-single.php in the parent theme you’ll find the following action hook:

    vantage_entry_main_bottom
    

    If you then go to /inc/template-tags.php in the parent theme and check from line 328 on you’ll find the vantage_get_post_categories function. Unfortunately, this function isn’t wrapped in a if function exists conditional so we can’t just go drop that function in the functions.php of our child theme. If this function was wrapped would just insert it into functions.php in the child theme and edit away.

    Here is a simple overview to what we’d need to adapt this function from our child theme:
    http://themeshaper.com/2009/05/03/filters-wordpress-child-themes/

    So…depending on the skills available on your side, I might be able to leave you here. Hopefully the above and this link will get you started:

    https://codex.wordpress.org/Function_Reference/get_taxonomies

  6. 8 years, 11 months ago Andrew Misplon
    Hi, I Work Here

    Correction: Sorry, the vantage_entry_main_bottom action hook isn’t being used. The function I discussed is just being outputted in content-single.php using the following:

    		<?php if(vantage_get_post_categories()) : ?>
    			<div class="entry-categories">
    				<?php echo vantage_get_post_categories() ?>
    			</div>
    		<?php endif; ?>
    

    So another way to do this would be to put content-single.php in your child theme and then remove:

    <?php echo vantage_get_post_categories() ?>
    

    Replacing it with your own function.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More