22Logo WordpressRich Snippets Codice per Tesi a tema

In risposta ad una query by Darko Kovancives on my previous article about fixing Rich Snippets code for the Mystique theme abbiamo risolto gli stessi problemi con il tema Thesis. I dettagli delle modifiche richieste sono al di sotto.

Before the file edits you need to carry out various other changes and tasks

  1. Get a google profile (i.e. un account google )
  2. Aggiungere l'indirizzo del tuo sito (ad es. https://diymediahome.org) to your google+ profile, as a public link
  3. Get your google plus ID and use it in place of mine in file edit number 5 sotto
  4. Change a Thesis setting for showing author on teasers in the options – Tesi: Opzioni di design: Teasers: Teaser Display Options: zecca “author name
  5. Change a Thesis setting for linking author in options – Tesi: Opzioni di design: Display Options: Bylines: “Link author names to archives

Ora faccio il file modifica come segue

1. Modifica linea 151 in content.php al nido la durata fn all'interno di un arco vcard

da

[php htmlscript=”1″]echo __(‘by’, ‘thesis’) . " <span class=\"author vcard$fn\">$autore</intervallo>";[/php]

a

[php htmlscript=”1″]echo __(‘by’, ‘thesis’) . " <span class=\"vcard\"><span class=\"author $fn\">$autore</intervallo></intervallo>";[/php]

2. Modifica linea 114 in content.php to provide updated date as well as published date

da

[php htmlscript=”1″]se ($data)
echo ‘<abbr class="published" title="’ . get_the_time(‘Y-m-d’) . ‘">’ . get_the_time(get_option(‘date_format’)) . '</abbr>’;[/php]

a

[php htmlscript=”1″]se ($data){
se(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>. Aggiornato <abbr class="updated" title="’ . get_the_modified_time(‘Y-m-d’) . ‘">’ . get_the_modified_time(get_option(‘date_format’)) . '</abbr>’;
}
altro{
echo ‘<abbr class="published updated" title="’ . get_the_time(‘Y-m-d’) . ‘">’ . get_the_time(get_option(‘date_format’)) . '</abbr>’;
}
}[/php]

3. Modifica linea 81 in teasers.php per includere data aggiornata

da

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

a

[php htmlscript=”1″]se(get_the_date()!= Get_the_modified_date()) echo ‘<abbr class="teaser_date published" 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).’"></intervallo></abbr>’."\n";
else echo ‘<abbr class="teaser_date published updated" title="’ . get_the_time(‘Y-m-d’) . ‘">’ . get_the_time($use_format) . "</abbr>\n";[/php]

4. Modificare il codice href autore on line 144 of content.php to add rel=”me”

da

[php htmlscript=”1″]$author = ‘<a href="’ . get_author_posts_url(get_the_author_ID()) . '" class="url fn"’ . $nofollow .’>’ . get_the_author() . '</un>’;[/php]

a

[php htmlscript=”1″]$author = ‘<a rel="me" href="’ . get_author_posts_url(get_the_author_ID()) . '" class="url fn"’ . $nofollow .’>’ . get_the_author() . '</un>’;[/php]

5. Modifica linea 308 in content.php inserire collegamento account Google

da

[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=\"http://plus.google.com/104657888470728381512/\">" . apply_filters(‘thesis_archive_intro_headline’, get_author_name($WP_Query->query_vars[‘author’])) . "</un></h1>\n"; #wp[/php]

Cosa ne pensi? Mandaci un commento qui sotto! Se si desidera iscriversi si prega di utilizzare il link iscriviti sul menu in alto a destra. È inoltre possibile condividere con i tuoi amici usando i link sottostanti sociali. Saluti.

lascia un commento

22 Commenti

gravatarJon Scaife

sì – I’ve had some syntax corrupted by the wordpress code editor and by a plugin. I’ve hopefully resolved this now and will be double checking the code on all posts over the weekend. Mi dispiace che!

rispondere
gravatarTodd

Grazie Jon. Brilliant fix. The Thesishcard errors cleaned up nicely.
We are having a related issue which maybe you’ll know the answer for. We have a some coding generating the hrecipe formatting and can see the markups when inspecting the post elements, but the rich snippet tool isn’t picking it up at all. The developer has no problems getting picked up on her site and others she has built out, but for some reason it isn’t getting picked up on a Thesis theme.

Don’t know if this is in your roundhouse, ma se si poteva prendere un look che sarebbe fantastico.

Ecco un post del nostro con il codice: Roasted Strawberry Muffin
Ecco uno di lei con il markup: Applesauce Muffins

Thanks again for the previous fix and for any help you can offer.

rispondere
gravatarTodd

Ho capito la risposta. The recipe was wrapped in a blockquote tag. Ho cambiato che a un tag div e tutto di corsa attraverso perfetto.

Thanks again on the previous hcard coding.

T

rispondere
gravatarJon Scaife

I think you’ve mixed up your rel=”me” and rel=”autore” tags a bit

You should only have a single rel=”me” collegamento – from your author page to your google profile. everywhere else you should have rel=”autore” tag. On your homepage each post has aby Wouter de Jonglink which points (correttamente) alla tua pagina dell'autore ), but you have rel=”me” on these links. It should be rel=”autore”

Once you change these rel=”me” links into rel=”autore” I think it will all workas it stands you’ve got multiple rel=”me” links on your author page, la maggior parte di essi a se stessa e solo 1 (correttamente) pointing to your google profile. I think this is confusing the snippet tool

rispondere
gravatarSante

Ciao Jon, it worked perfectlyI didn’t include items 4 e 5 from your list as they are not essential to validate the rich snippet and I’m not betting on Google+ just yet so I don’t want tolittermy themes 🙂

Thanks for the tip 🙂

rispondere
gravatararafinshaon

having trouble @ Jon Scaife i’m not getting exactly the same code into content.php file. Sto utilizzando tesi 1.8.2. waiting 4 your response….

rispondere
gravatararafinshaon

ho fatto esattamente questo. after doing this my Authorship markup got verified but unfortunately I’m getting below errors .

avvertimento: Manca campo obbligatorio “aggiornato”.
avvertimento: Almeno un campo deve essere impostato per hCard.
avvertimento: Manca campo obbligatorio “nome (fn)”.

Devo attendere alcuni giorni per la scansione?

rispondere
gravatarJon Scaife

Qual è il tuo indirizzo del sito? Which page are you getting the errors on? La homepage, un post o entrambi? Have you made any other modifications to the themelike adding extra files or using a child theme?

rispondere
gravatarJon Scaife

scusate – quindi installali tramite Gestione dispositivi e quindi installa la toolbox canon canoscan per Vista x32. Ho calcolato fuori. The code had got mangled by wordpress. I think when I update the post wordpress processes some of the code and takes some of the classes out which makes it disfunctional. I’ve corrected it. Si prega di dare una prova ora.

rispondere
gravatarEko Y

Grazie, very useful info. Ma, how to add meta tags information like this blog? It looks if i do right click in browser >> view page info. There are many information on general tab. Come Autore, Viewport Etc. My blog is just contain : contenuto, robot, descriptions, keywords in page info..How to get this snippet?
Grazie..

rispondere
gravatarJon Scaife

Most of that comes from using a semantic HTML5 theme for wordpress combined with the Yoast QUESTO plugin. I also have various meta files like humans.txt and robots.txt. Have a look at the wordpress guide for loads of information about improving your wordpress setup.

rispondere