Navigation überspringen

[Gelöst] Can't seem to display post type taxonomy description

This support ticket is created vor 2 Jahre. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 1 Antwort, hat 2 Stimmen.

Zuletzt aktualisiert von Minesh vor 2 Jahre.

Assistiert von: Minesh.

Author
Artikel
#2622851

I have this code:

<?php
global $post_type;
$obj = get_post_type_object($post_type);
echo $obj->description; ?>

It works on the normal custom post archives and posts, but when I load a custom taxonomy page, the description of the custom post type disappears.

There is probably a better way to do the code above that would display the custom post description on all relevant pages? Any help would be much appreciated!

#2622877

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As I understand you are trying to get the post type object on taxonomy archive page:

Please check the following reference link that shows how you can get the post type object on taxonomy archive page:
- https://wordpress.stackexchange.com/questions/256484/get-the-posttype-of-a-taxonomy-term