• Skip to primary navigation
  • Skip to main content
  • Skip to footer

altaneus

Pensées pour moi-même...

  • Home
  • Snippets
  • About

Add schema.org attribute to the featured image

2 January 2015 par Stefano

<?php

// Wordpress only
the_post_thumbnail('thumbnail', array('itemprop' => 'image'));

// Genesis

$image_args = array(
         'attr' => array(
             'itemprop' => 'image',
       ),
);

genesis_image( $image_args );

Featured image code

2 January 2015 par Stefano

<?php
// Do not include the above.

if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
          $image_args = array(
            'size' => 'full',
            'attr' => array(
        'class' => 'alignleft post-image entry-image',
                'itemprop' => 'image',
            ),
        );
        echo '<div class="entry-featured-image">';
        genesis_image( $image_args );
        echo '</div>';
}
  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3
  • Page 4

Footer

Recent Posts

  • Jetpack Stats – il va falloir payer
  • Jetpack Personal : augmentation de prix
  • Générateurs de mots de passes
  • Générateur de GUID/UUID
  • Appareil photo du Samsung S22 Ultra

Categories

  • Apache
  • Cloudflare
  • DNS
  • Genesis
  • Infomaniak
  • Jetpack
  • Non classé
  • Outils
  • Photographie
  • Sécurité
  • Uncategorized
  • Wordpress
  • WP Rocket

Copyright © 2025 · Genesis Framework · WordPress · Log in