Solved

Wordpress Custom Post Type category description text

Posted on 2016-10-05
5
60 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 108

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
In order to have all security and back ups taken care of, WordPress users can sign up for services with WP Engine.
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

895 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

11 Experts available now in Live!

Get 1:1 Help Now