Ade-más de a este sitio tengo un personal blog donde, amongst other things, Puedo publicar recetas. Recientemente he descubierto una nueva búsqueda de recetas de google, y han estado buscando para implementar el soporte para los microformatos / microdatos. Google ofrece una herramienta para el check-ing su margen de beneficio, llamado el "rica herramienta ing test-snip-mascotas”. Cuando probé una de mis recetas ing val-id-at-, Me encontré con errores vari-ous, que me han tomado un tiempo para localizar y resolver.
1. El primer problema fue con la información del autor / hrecipe section
La solu-ción:
Usted necesita un pro-file google. Tu perfil de Google debe estar vinculado de alguna parte de la página, con rel = "me", Y el dominio principal de su sitio web debe estar incluido en sus enlaces perfil de Google.
I achieved this with the Mystique theme with a series of modifications.
Primero, He añadido el código de Yoast (como se muestra a continuación) a functions.php
1 2 3 4 5 6 | function yoast_add_google_profile( $contactmethods ) { // Add Google Profiles $contactmethods['google_profile'] = 'Google Profile URL'; return $contactmethods; } add_filter( 'user_contactmethods', 'yoast_add_google_profile', 10, 1); |
Segundo, I went to my wordpress profile page and filled in the google profile field with a link to my google profile
Tercera, He editado una línea para author.php, de nuevo, basado en informar-a-ción de Yoast, pero cambió para el tema Mys-tique
in this section
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | if(($curauth->user_url<>'http://') && ($curauth->user_url<>'')) echo ' '.__('Homepage:','mystique').' <a href="'.$curauth->user_url.'">'.$curauth->user_url.'</a> '; if($curauth->yim<>'') echo ' '.__('Yahoo Messenger:','mystique').' <a href="ymsgr:sendIM?'.$curauth->yim.'">'.$curauth->yim.'</a> '; if($curauth->jabber<>'') echo ' '.__('Jabber/GTalk:','mystique').' <a href="gtalk:chat?jid='.$curauth->jabber.'">'.$curauth->jabber.'</a> '; if($curauth->aim<>'') echo ' '.__('AIM:','mystique').' <a href="aim:goIM?screenname='.$curauth->aim.'">'.$curauth->aim.'</a> '; |
añadir esta línea adicional
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | if(($curauth->user_url<>'http://') && ($curauth->user_url<>'')) echo ' '.__('Homepage:','mystique').' <a href="'.$curauth->user_url.'">'.$curauth->user_url.'</a> '; if($curauth->yim<>'') echo ' '.__('Yahoo Messenger:','mystique').' <a href="ymsgr:sendIM?'.$curauth->yim.'">'.$curauth->yim.'</a> '; if($curauth->jabber<>'') echo ' '.__('Jabber/GTalk:','mystique').' <a href="gtalk:chat?jid='.$curauth->jabber.'">'.$curauth->jabber.'</a> '; if($curauth->aim<>'') echo ' '.__('AIM:','mystique').' <a href="aim:goIM?screenname='.$curauth->aim.'">'.$curauth->aim.'</a> '; if($curauth->google_profile<>'') echo ' <a href="' . $curauth->google_profile . '" rel="me">Google Profile</a> '; |
Próximo, He editado single.php añadir rel = "autor" al enlace a mi página de autor. En el tema Mystique esto se encuentra hacia la parte inferior del archivo, within the (largo) línea(s) como se muestra a continuación. He añadido el rel = "autor" al final de la primera línea antes de la href = "parte
1 2 | printf(__('This entry was posted by %1$s on %2$s at %3$s, and is filed under %4$s. Follow any responses to this post through %5$s.', 'mystique'), '<a title="'. sprintf(__(" href="'. get_author_posts_url(get_the_author_meta('ID')) .'" rel="author">'. get_the_author() .'</a>', get_the_time(get_option('date_format')),get_the_time(get_option('time_format')), get_the_category_list(', '), '<a title="RSS 2.0" href="'.get_post_comments_feed_link($post->ID).'">RSS 2.0</a>');echo ' '; |
Entonces, por último añadir la misma rel = "autor" a la línea 670 de core.php
Cuando esto se lleva a cabo correctamente, debería obtener un mensaje de éxito en la herramienta de prueba de fragmentos que dice Cado-Veri: Marcado autoría es cor-recto para esta página
2. El segundo problema(s) estaban con el hfeed / hentry section and included the following:
Miss-ing hCard requerido "autor".
Tes-tigo: Al menos un campo se debe establecer para hCard.
Tes-tigo: Al menos un campo se debe establecer para Hat-o-Mentry.
Tes-tigo: -Ing señorita campo obligatorio "entry-título".
Tes-tigo: Miss-ing campo obligatorio "actualizado".
Tes-tigo: Miss-ing hCard requerido "autor".
La solución(s):
Use the wordpress editor to edit single.php
Encuentra el código
1 2 3 | </pre> <h1 class="title"></h1> <pre> |
reemplazar esto con ...
1 2 3 4 5 | </pre> <h1 class="title entry-title"></h1> <h2 class="updated"></h2> <h2 class="vcard"></h2> <pre> |
Una nota final - No se limite a copiar y pegar el código de esta página, as for some reason (Estoy ca-ca-ter ENCOD-ing ing guess-) no lo puedo trabajar. Copie desde aquí y pegar en el bloc de notas de Windows. Luego vuelva a copiarlo de ventanas nota-pad (or any other basic plain-text-only editor) and paste into the wordpress editor. Going via notepad loses any hidden encoding or other data which causes a problem so the code is treated as the plain-text it is supposed to be
Encontrado esto útil? Por favor, háganos saber dejando caer un comentario más abajo. Si desea suscribirse por favor utilice el enlace de suscripción en el menú en la parte superior derecha. También puede compartir esto con tus amigos mediante el uso de los enlaces sociales inferiores. Aclamaciones.
Deja una respuesta