$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>archives - Where is the content that is outputted by get_the_archive_description()?|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

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

matteradmin8PV0评论

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.

Post a comment

comment list (0)

  1. No comments so far