22Logo WordpressRich Snippets Código de tema de tesis

En respuesta a una Consulta por Darko forjó Cives en mi pre-vi-ous art-ículo sobre[int­link id=“1520” type=“post”]fixing Rich Snip­pets code for the Mys­tique theme[/intlink] we have resolved the same issues with the Thes­is theme. Details of the changes required are below.

Before the file edits you need to carry out vari­ous oth­er changes and tasks

  1. Obtener una pro-file google (es decir. una cuenta de Google )
  2. Agregue la dirección de su sitio (e.g. https://diymediahome.org) a su pro-file Google , como un vínculo pública
  3. Get your google plus ID and use it in place of mine in file edit num­ber 5 below
  4. Change a Thes­is set­ting for show­ing author on teas­ers in the options — Thes­is: Opciones de Diseño: Tés-res: Teas­er Dis­play Options: Tick ​​"nombre del autor"
  5. Change a Thes­is set­ting for link­ing author in options — Thes­is: Opciones de Diseño: Opciones Dis-play: Bylines: "Los nombres de Enlace de autor a los archivos"

Ahora haga el archivo edita la siguiente manera

1. Línea de edición 151 en content.php anidar el lapso fn dentro de un lapso de vcard

de

[php htmlscript=“1”]echo __(‘by’, ‘thes­is’) . " <span class=\“author vcard$fn\”>$autor</lapso>";[/php]

a

[php htmlscript=“1”]echo __(‘by’, ‘thes­is’) . " <span class=\“vcard\”><span class=\“author $fn\”>$autor</lapso></lapso>";[/php]

2. Línea de edición 114 en content.php para proporcionar la fecha actualizada, así como fecha de publicación

de

[php htmlscript=“1”]si ($fecha)
echo ‘<abbr class=“published” title=“ ‘ . get_the_time(‘Y‑m-d’) . ’ ”>’ . get_the_time(get_option(‘date_format’)) . '</abbr>’;[/php]

a

[php htmlscript=“1”]si ($fecha){
si(get_the_date()!= Get_the_modified_date()){
echo ‘<abbr class=“published” title=“ ‘ . get_the_time(‘Y‑m-d’) . ’ ”>’ . get_the_time(get_option(‘date_format’)) . '</abbr>. Actualizado <abbr class=“updated” title=“ ‘ . get_the_modified_time(‘Y‑m-d’) . ’ ”>’ . get_the_modified_time(get_option(‘date_format’)) . '</abbr>’;
}
más{
echo ‘<abbr class=“published updated” title=“ ‘ . get_the_time(‘Y‑m-d’) . ’ ”>’ . get_the_time(get_option(‘date_format’)) . '</abbr>’;
}
}[/php]

3. Línea de edición 81 en teasers.php incluir fecha de actualización

de

[php htmlscript=“1”]echo ‘<abbr class=“teaser_date pub­lished” title=“ ‘ . get_the_time(‘Y‑m-d’) . ’ ”>’ . get_the_time($use_format) . "</abbr>\n”;[/php]

a

[php htmlscript=“1”]si(get_the_date()!= Get_the_modified_date()) echo ‘<abbr class=“teaser_date pub­lished” title=“ ‘ . get_the_time(‘Y‑m-d’) . ’ ”>’ . get_the_time($use_format) . '</abbr><abbr class=“teaser_date updated” title=“ ‘ . get_the_modified_time(‘Y‑m-d’) . ’ ”><span class=“value-title” title=“ ‘.get_the_modified_time($use_format).’ ”></lapso></abbr>’.”\n”;
else echo ‘<abbr class=“teaser_date pub­lished updated” title=“ ‘ . get_the_time(‘Y‑m-d’) . ’ ”>’ . get_the_time($use_format) . "</abbr>\n”;[/php]

4. Editar el código href autor en línea 144 de content.php añadir rel = "me"

de

[php htmlscript=“1”]$author = ‘<a href=“ ‘ . get_author_posts_url(get_the_author_ID()) . ’ ” class=“url fn“ ‘ . $nofol­low .’>’ . get_the_author() . '</a>’;[/php]

a

[php htmlscript=“1”]$author = ‘<a rel=“me” href=“ ‘ . get_author_posts_url(get_the_author_ID()) . ’ ” class=“url fn“ ‘ . $nofol­low .’>’ . get_the_author() . '</a>’;[/php]

5. Línea de edición 308 en content.php insertar enlace cuenta de google

de

[php htmlscript=“1”]$output .= “$tab\t<h1>" . apply_filters(‘thesis_archive_intro_headline’, get_author_name($WP_Query->query_vars[‘author’])) . "</h1>\n”; #wp[/php]

a

[php htmlscript=“1”]$output .= “$tab\t<h1><a rel=\“me\” href=\“https://plus.google.com/104657888470728381512/\”>" . apply_filters(‘thesis_archive_intro_headline’, get_author_name($WP_Query->query_vars[‘author’])) . "</a></h1>\n”; #wp[/php]

Deja una respuesta

22 Comments

JSJon Scaife

Yes — I’ve had some syn­tax cor­rup­ted by the word­press code edit­or and by a plu­gin. Espero haber resuelto esto ahora y estaré doble control el código de todos los mensajes durante el fin de semana. Lo siento por eso!

Respuesta
TTodd

Gracias Jon. Fix Bril-liant. The Thes­is’ hcard errors cleaned up nicely.
Estamos teniendo un problema conexo que tal vez usted sabrá la respuesta para. Tenemos una cierta codificación generar el formato hrecipe y podemos ver las marcas de la hora de inspeccionar los elementos postales, pero la herramienta fragmento rico es no elegir es en absoluto. El desarrollador no tiene problemas para ser recogido en su sitio y otros que ha construido con, but for some reas­on it isn’t get­ting picked up on a Thes­is theme.

No sé si esto es en su ida y casa, but if you could take a look that would be awesome.

Aquí hay un puesto de la nuestra con el marcado: Roas-ted Straw-berry Muffin
Aquí está uno de los suyos con el marcado: Muffins de manzana y salsa

Gracias de nuevo por la solución anterior y para cualquier ayuda que pueda ofrecer.

Respuesta
TTodd

Me di cuenta de la respuesta. La receta estaba envuelto en una etiqueta de bloque-cita. I changed that to a div tag and everything ran through perfect.

Thanks again on the pre­vi­ous hcard coding.

T

Respuesta
JSJon Scaife

Creo que te has metido tu rel = "me" y rel = "autor" etiquetas un poco

Usted sólo debe tener un único enlace rel = "me" - de su página autora a tu perfil google. en cualquier otro lugar usted debe tener rel = tag "de autor". En su página de inicio que los temas tienen un enlace de "por Wouter de Jong", donde los puntos (correctamente) a tu página del autor ), pero usted tiene rel = "me" en estos enlaces. Debe ser rel = "autor"

Una vez que cambie estos rel = "me" enlaces en rel = "autor" Creo que va a todo el trabajo - en su forma actual que tienes múltiples rel = "me" enlaces de una página del autor, la mayoría de ellos de nuevo a sí mismo y sólo 1 (correctamente) punto-ción a su pro-file google. Creo que esto se con-fus-ing de la herramienta de recorte para mascotas

Respuesta
SSante

Hola jon, it worked per­fectly — I did­n’t include items 4 y 5 from your list as they are not essen­tial to val­id­ate the rich snip­pet and I’m not bet­ting on Google+ just yet so I don’t want to “lit­ter” my themes 🙂

Gracias por la punta 🙂

Respuesta
Laarafinshaon

teniendo problemas @ Jon Scaife No estoy recibiendo exactamente el mismo código en el archivo content.php. I’m using thes­is 1.8.2. esperar-ing 4 su respuesta ....

Respuesta
JSJon Scaife

You might have to search for sim­il­ar code on slightly dif­fer­ent line num­bers. Si me envías tu content.php tendré una mirada

Respuesta
Laarafinshaon

Lo hice exactamente. after doing this my Author­ship markup got veri­fied but unfor­tu­nately I’m get­ting below errors .

Tes-tigo: Miss-ing campo obligatorio "actualizado".
Tes-tigo: Al menos un campo se debe establecer para hCard.
Tes-tigo: Miss-ción requerida campo "Nombre (fn)".

¿Tengo que esperar unos días para el rastreo?

Respuesta
JSJon Scaife

¿Cuál es la dirección del sitio? ¿Qué página es usted conseguir-ting los errores en? La página de inicio, un mensaje o ambos? Have you made any oth­er modi­fic­a­tions to the theme — like adding extra files or using a child theme?

Respuesta
JSJon Scaife

Lo sentimos - mi culpa. Yo he descubierto. El código se quedó destrozado por el boca-press. I think when I update the post word­press pro­cesses some of the code and takes some of the classes out which makes it dis­func­tion­al. He Cor-rec-ted que. Por favor, darle una oportunidad ahora.

Respuesta
EYEko Y

Gracias, uso-ful información muy. Pero, cómo añadir información de las etiquetas meta como este blog? Se ve si hago click derecho en el navegador »ver el las páginas de información. There are many inform­a­tion on gen­er­al tab. Como Autor, Etc Ver puertos. Mi blog es sólo con-tienen : con-tenido, robots, descripciones, las palabras clave en la página info..How para obtener este fragmento?
Gracias..

Respuesta
JSJon Scaife

Most of that comes from using a semant­ic HTML5 theme for word­press com­bined with the Yoast ESTE plu-gin. También tengo varios archivos de metadatos como humans.txt y robots.txt. Echa un vistazo a la guía de wordpress para un montón de información acerca de la mejora de su instalación de WordPress.

Respuesta