Skip to content

Instantly share code, notes, and snippets.

View barking-horse's full-sized avatar
👋

Agence Appaloosa barking-horse

👋
View GitHub Profile
@barking-horse
barking-horse / Shemas.org Wordpress blog post
Last active March 19, 2021 11:40
Add Schema.org Markup to WordPress post for a Better SEO
<article <?php post_class(); ?> id="post-<?php the_ID(); ?>" itemscope itemtype="https://schema.org/Article">
<header>
<?php the_title( '<h1 class="title entry-title" itemprop="headline">', '</h1>' ); ?>
<?php echo get_the_post_thumbnail( $post->ID, 'hero', array('class' => 'img-fluid mx-auto', 'itemprop' => 'image') ); ?>
<div class="entry-meta">
<time pubdate itemprop="datePublished" datetime="<?php the_time( 'c' ); ?>" content="<?php the_time( 'c' ); ?>">
<?php the_time( get_option( 'date_format' ) ); ?>
</time>
<div>Catégories: <span itemprop="about"><?php the_category(', '); ?></span></div>
<div>Tags: <span itemprop="keywords"><?php the_tags(''); ?></span></div>