Solved

Wordpress Custom Post Type category description text

Posted on 2016-10-05
5
48 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
I suspected this was easy...Thanks!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

WordPress is constantly evolving, and with each evolution appears to get better and better.  One of the big drawbacks prior to version 3 was that there was no way to be able to set up a custom menu from the backend. The Old Way Adding menus is…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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 set up the permalinks on a WordPress Website. 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 : Go t…

763 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

8 Experts available now in Live!

Get 1:1 Help Now