Solved

Wordpress Custom Post Type category description text

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

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
This article discusses four methods for overlaying images in a container on a web page
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

734 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