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

WP SITES

2669

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Tutorial Requests
  • Contact
  • Videos
  • Tags
  • Log in

Premium Member? - Request custom code

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

Brad Dalton Specializes In Genesis child theme customization & code modification. Read More…

Learn PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems