Langsung aja berikut adalah kode yang cukup di masukkan ke dalam file single.php pada wordpress, jangan lupa sesuaikan tata letaknya supaya bagus tampilannya.
1. Rich Snippet Recipe
<!-- start rich snippet --> <fieldset class="richsnippet"> <legend>Summary</legend> <div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Recipe"> <span rel="v:photo"/><img width="65px" align="left" src="<?php $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full"); echo $imgsrc[0];?>" /></span> <span class="entry-title"><strong><?php the_title(); ?></strong></span> by <span class="vcard author"> <span class="fn"><?php the_author(); ?></span> </span> on <span property="v:published" datetime="<?php the_date('F j, Y'); ?>"><?php the_time('l, F jS, Y') ?></span> <span class="date updated"><?php the_time(); ?></span> <span property="v:summary"><?php the_excerpt(); ?></span> <span property="v:name"><?php the_title(); ?></span> <span rel="v:Review"> <span typeof="v:Review-aggregate"> <span rel="v:rating"> <span typeof="v:Rating"> <span property="v:average"><?php echo rand(4.5,5);?></span> <span property="v:count"><?php echo rand(35,50);?></span> </span> </span> </span> </span> </div> </fieldset> <!-- end rich snippet -->
2. Rich Snippet Review With Stars
<!-- start rich snippet --> <div itemscope itemtype="http://data-vocabulary.org/Review"> <fieldset class="richsnippet"> <legend>Summary</legend> <img itemprop="photo" width="80px" align="left" src="<?php $imgsrc = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), "Full"); echo $imgsrc[0]; ?>" /> <span itemprop="itemreviewed"><strong><?php the_title(); ?></strong></span> Reviewed by <span itemprop="reviewer"><?php the_author(); ?></span> on <time itemprop="dtreviewed" datetime="<?php the_date('F j, Y'); ?>"><?php the_time('l, F jS, Y') ?></time>. <span itemprop="summary">This Is Article About <?php the_title(); ?></span> <span itemprop="description"><?php the_excerpt(); ?></span> Rating: <span itemprop="rating"><?php echo rand(4.5,5);?></span> </fieldset> </div> <!-- end rich snippet -->
Selamat mencoba, mohon dikoreksi jika ada kekurangan ….. salam
Related Search
Tags: #GOOGLE #wordpress