Answers for "wordpress change post format"

PHP
0

wordpress change post format

add_theme_support( 'post-formats', array('aside','video','gallery','chat'));

function rename_post_formats($translation, $text, $context, $domain) {
    $names = array(
        'Aside'  => 'No Featured image',
        'Chat'  => 'Full Width',
    );
    if ($context == 'Post format') {
        $translation = str_replace(array_keys($names), array_values($names), $text);
    }
    return $translation;
}
add_filter('gettext_with_context', 'rename_post_formats', 10, 4);
Posted by: Guest on June-12-2021

Browse Popular Code Answers by Language