archives - Where is the content that is outputted by get_the_archive_description()?

admin2025-06-04  12

I need an intro text to a custom post type archive, so I want to use get_the_archive_description(). Thing is, I can't figure out where in the admin is the text that is gonna be outputted by this function.

So where is it?

I need an intro text to a custom post type archive, so I want to use get_the_archive_description(). Thing is, I can't figure out where in the admin is the text that is gonna be outputted by this function.

So where is it?

Share Improve this question edited Jan 15, 2019 at 20:20 fuxia 107k39 gold badges255 silver badges461 bronze badges asked Jan 15, 2019 at 20:19 Fredy31Fredy31 8782 gold badges16 silver badges31 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

That function starts like this:

function get_the_archive_description() {
    if ( is_author() ) {
        $description = get_the_author_meta( 'description' );
    } elseif ( is_post_type_archive() ) {
        $description = get_the_post_type_description();
    } else {
        $description = term_description();
    }

so you're looking at get_the_post_type_description().

If you check the docs for register_post_type() you'll see that description is one of the args that this takes. So you need to either use a plugin/write code to create a place to add this text in the backend, and then dynamically fill that arg with your custom field content, or you need to add the text in code where you're registering the CPT.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1749007461a315566.html

最新回复(0)