0

I have two custom post types "Product" and "News". I want to keep a description that describes each of these types and I want to display it under the custom post title inside a banner. Also the user should be able to change it from admin dashboard. That means when I go to products page, there is a banner on top of the page and the title will be PRODUCTS and then product description should be displayed.

EX:

PRODUCTS

PRODUCTS DESCRIPTION

Now if I can add a meta box common to the product cpt which has an input field, I can display it on the web page. But I only know how to add meta boxes to each products under product type.

How do I solve this?

2 Answers 2

0

You have a few potential options that I can see:

  1. Each CPT has a parameter for a Description, and you could access that via a plugin like CPT UI for admin purposes (though not ideal if you want non-admin users to have access to control the Description!)
  2. Create a theme/plugin option page to control the Description parameter so that you limit the non-admin control to just that
  3. Create a theme/plugin option page that uses general text fields to populate the description for you. You could use ACF Theme Options to do this quickly and simply if you preferred this route

Have a look at:

Accessing the Description parameter in a CPT

ACF Theme Options Page

1
  • I was trying to achieve this without a plugin but hey why bother when you got acf. thnx for the reply..
    – xandar6
    Aug 29, 2020 at 6:01
0

You can use advanced-custom-fields plugin and create two fields one for title and one for description and specify their locations for posts types (PRODCUTS and NEWS) and then you can give title and description for each of the custom post types seprately.: enter image description here

1
  • yes this is the way to go thnx
    – xandar6
    Aug 29, 2020 at 6:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.