Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Wordpress Custom Post Type category description text

Posted on 2016-10-05
5
Medium Priority
?
213 Views
Last Modified: 2016-10-07
Hi! I installed the Custom Post Type UI plugin which makes it easy to create a custom post type. I have a page that renders the full list of posts in this custom post type - the standard "archive" page. But if you type in a category description for a custom post type, it doesn't seem straightforward how I would show this information on the given archive page for a custom post type category.

I'm not terribly strong in PHP, but I can modify (child) theme files to customize as needed.

I'm just not sure where to start. My custom post type name is 'protocols', and lets say my protocol category is "XYZ" with ID of '123'. Any recommendation on syntax and where I'd place this code to sense the current category page we are viewing and display the description text above the blog roll loop?

Thanks
0
Comment
Question by:billium99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 111

Expert Comment

by:Ray Paseur
ID: 41831866
This expert suggested creating a Gigs project.
This might be a good post for E-E Gigs.  When you're not sure where to start, it's often helpful to have an expert take on the task and explain the solution step-by-step.
0
 
LVL 1

Author Comment

by:billium99
ID: 41831883
I have to admit, I haven't used EE in almost a year. A gigs project? In other words, instead of getting recommendations and code suggestions from someone who finds this question trivial, I should hire someone?

Bill
0
 
LVL 35

Expert Comment

by:Terry Woods
ID: 41832870
To put a more positive spin on it, I'd word it as offering out a package of work for a fixed price when a problem is too unclear or too difficult to get a solution through the free Q&A. But the hiring part is essentially correct, yes.

With the Custom Post Types I've added on my own site, there's no Category by default. Have you created a custom category (I think the official term is taxonomy)?

I think what you're asking for in this case is relatively simple, so probably doesn't justify using a (paid) Gig through complexity, though you may get a better response time.
0
 
LVL 70

Accepted Solution

by:
Jason C. Levine earned 2000 total points
ID: 41834458
Category descriptions, whether they are for normal posts or custom post types, are handled with the category_description() function.

 <?php echo category_description( $category_id ); ?>

So all you need to do is put that into your theme template file(s) wherever you want it to show up.
1
 
LVL 1

Author Closing Comment

by:billium99
ID: 41834478
I suspected this was easy...Thanks!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question