“Post Format WordPress” Réponses codées

Format de date dans WordPress Post

Posted on <?php the_time( 'l, F jS, Y' ); ?>.
Agreeable Anteater

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);
Faiz

Post Format WordPress

add_theme_support( 'post-formats', array( 'aside', 'gallery' ) );
Ar Asru

has_post_format wordpress

if ( has_post_format( 'aside' )) {
  // do something for asides
} elseif ( has_post_format( 'image' )) {
  // something for images
} elseif ( has_post_format( 'video' )) {
  // etc, etc
}
 // etc, etc
Innocent Ibis

Réponses similaires à “Post Format WordPress”

Questions similaires à “Post Format WordPress”

Plus de réponses similaires à “Post Format WordPress” dans PHP

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code