Displaying category descriptions using custom taxonomy and cpt
-
Hi,
I try to displaying category descriptions using custom taxonomy and CPT and since I use the Divi visual builder, my idea is to retrieve it by using a shortcode inside the Code Divi Module and defining the function inside functions.phpThe problem is, I can’t make it work within the CPT environment. It just works with the normal post types and default category.
Here the code I use:
function wpb_catlist_desc() { $catID = get_the_category(); return category_description($catID[0]); } add_shortcode('cat_desc', 'wpb_catlist_desc');
…and the shordcode for this is: [cat_desc]
i would be grateful if someone can help me with this as i dont know what i am doing wrong and i am not PHP expert either, thanks!
Fery
The page I need help with: [log in to see the link]
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Displaying category descriptions using custom taxonomy and cpt’ is closed to new replies.