• I’m trying to rename my Excerpt field in the editor for a custom post type “slideshow” I’ve been able to rename the field globally but I’d like it to only change for the slideshow post type. I put this in my functions.php but it doesn’t do anything.

    add_filter( 'gettext', 'change_excerpt_name', 20, 3 );
    function change_excerpt_name( $translated_text, $text, $domain ) {
    
        if( $_GET['post_type'] == 'slideshow' ) {
    
            switch ( $translated_text ) {
    
                case 'Excerpt' :
    
                    $translated_text = 'Link';
                    break;
    
                case 'Excerpts are optional hand-crafted summaries of your content that can be used in your theme. <a href="http://codex.wordpress.org/Excerpt" target="_blank">Learn more about manual excerpts.</a>' :
    
                    $translated_text = 'This is the link to the portfolio so that when a slide is clicked it takes them to the correct portfolio page. It should look something like /portfolio/post-name/';
                    break;
    
            }
    
        }
    
        return $translated_text;
    }

The topic ‘Rename Excerpt in Custom Post Type’ is closed to new replies.