• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Rename Post Formats In WordPress

This code enables you to rename post formats via your child themes functions file :

add_filter( 'gettext_with_context', 'rename_post_formats', 10, 4 );

function rename_post_formats( $translation, $text, $context, $domain ) {

    $names = array(
        'Audio'  => 'Custom Name',
        'Chat' => 'Custom Name',
        'Aside' => 'Custom Name',
    );
    
    if ( $context == 'Post format' ) {
        $translation = str_replace( array_keys( $names ), array_values( $names ), $text );
    }
    
    return $translation;
}

Here’s an example :

Related Tutorials

  • Add Post Formats In Genesis

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.