Solved

Wordpress Custom Post Type category description text

Posted on 2016-10-05
5
64 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
5 Comments
 
LVL 109

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 500 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
This video teaches users how to migrate an existing Wordpress website to a new domain.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now