<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>Aldolat.it &#8212; Post con tag Codice</title>
        <link>https://www.aldolat.it/tags/codice/</link>
        <description>Ultimi post pubblicati nel tag Codice &#8212; aldolat.it</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>it</language>
        <managingEditor>aldolat@gmail.com (Aldo Latino)</managingEditor>
        <webMaster>aldolat@gmail.com (Aldo Latino)</webMaster>
        <copyright>Creative Commons BY-SA 4.0</copyright>
        <lastBuildDate>Tue, 19 Aug 2025 08:33:44 +0200</lastBuildDate>
        <atom:link href="https://www.aldolat.it/tags/codice/index.xml" rel="self" type="application/rss+xml" />
        <item>
            <title>Una pezza per SyntaxHighlighter</title>
            <link>https://www.aldolat.it/posts/2019/una-pezza-per-syntaxhighlighter/</link>
            <pubDate>Sat, 19 Jan 2019 20:21:19 +0000</pubDate>
            <author>aldolat@gmail.com (Aldo Latino)</author>
            <guid>https://www.aldolat.it/posts/2019/una-pezza-per-syntaxhighlighter/</guid>
            <description>Con una funzione molto semplice è possibile mettere una pezza al problema del plugin SyntaxHighlighter, che segnalavo qui.&#xA;Grazie a @kaggdesign per la condivisione.</description>
            <content:encoded>&lt;p&gt;Con una funzione molto semplice è possibile &lt;a href=&#34;https://wordpress.org/support/topic/ampersand-character/#post-11108085&#34;&gt;mettere una pezza&lt;/a&gt; al problema del plugin SyntaxHighlighter, che segnalavo &lt;a href=&#34;https://www.aldolat.it/2019/asides/wordpress-syntaxhighlighter-evolved-escaping/&#34;&gt;qui&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Grazie a &lt;a href=&#34;https://wordpress.org/support/users/kaggdesign/&#34;&gt;@kaggdesign&lt;/a&gt; per la condivisione.&lt;/p&gt;&#xA;&lt;p&gt;L&#39;articolo &lt;a href=&#34;https://www.aldolat.it/posts/2019/una-pezza-per-syntaxhighlighter/&#34;&gt;Una pezza per SyntaxHighlighter&lt;/a&gt; è uno scritto di &lt;a href=&#34;https://www.aldolat.it/&#34;&gt;aldolat.it&lt;/a&gt;. Rispettane le &lt;a href=&#34;https://www.aldolat.it/info/#licenza&#34;&gt;condizioni di licenza&lt;/a&gt;.&lt;/p&gt;</content:encoded>
        </item>
        <item>
            <title>WordPress 5, SyntaxHighlighter Evolved e il carattere «&amp;»</title>
            <link>https://www.aldolat.it/posts/2019/wordpress-syntaxhighlighter-evolved-escaping/</link>
            <pubDate>Wed, 09 Jan 2019 18:24:17 +0000</pubDate>
            <author>aldolat@gmail.com (Aldo Latino)</author>
            <guid>https://www.aldolat.it/posts/2019/wordpress-syntaxhighlighter-evolved-escaping/</guid>
            <description>C&amp;rsquo;è attualmente un problema, confermato da Alex Mills, a.k.a. @viper007bond, circa il corretto escaping del carattere &amp;amp; in WordPress. Trovate la mia discussione con Alex nel forum di WordPress.&#xA;Dalle mie prove sembrerebbe che il problema si presenti solo nei pezzi di codice pubblicati in un post usando il plugin SyntaxHighlighter Evolved. Ad esempio:&#xA;Qui ho usato il blocco standard di WordPress per il codice e il carattere è correttamente mostrato.&#xA;Qui, invece, usando il blocco del plugin SyntaxHighlighter Evolved, no.</description>
            <content:encoded>&lt;p&gt;C&amp;rsquo;è attualmente un problema, confermato da Alex Mills, a.k.a. &lt;a href=&#34;https://profiles.wordpress.org/viper007bond&#34;&gt;@viper007bond&lt;/a&gt;, circa il corretto &lt;em&gt;escaping&lt;/em&gt; del carattere &lt;code&gt;&amp;amp;&lt;/code&gt; in WordPress. Trovate la mia discussione con Alex &lt;a href=&#34;https://wordpress.org/support/topic/ampersand-character/&#34;&gt;nel forum di WordPress&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Dalle mie prove sembrerebbe che il problema si presenti solo nei pezzi di codice pubblicati in un post usando il plugin &lt;a href=&#34;https://wordpress.org/plugins/syntaxhighlighter/&#34;&gt;SyntaxHighlighter Evolved&lt;/a&gt;. Ad esempio:&lt;/p&gt;&#xA;&lt;figure class=&#34;aligncenter&#34;&gt;&lt;img src=&#34;https://www.aldolat.it/images/2019/01/standard-wp-code-block.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Qui ho usato il blocco standard di WordPress per il codice e il carattere è correttamente mostrato.&lt;/p&gt;&#xA;&lt;figure class=&#34;aligncenter&#34;&gt;&lt;img src=&#34;https://www.aldolat.it/images/2019/01/syntax-highlighter-block-code.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Qui, invece, usando il blocco del plugin SyntaxHighlighter Evolved, no.&lt;/p&gt;&#xA;&lt;p&gt;Alex ha aperto &lt;a href=&#34;https://github.com/WordPress/gutenberg/issues/13218&#34;&gt;un ticket su Github&lt;/a&gt; in quanto dipenderebbe da WordPress.&lt;/p&gt;&#xA;&lt;p&gt;L&#39;articolo &lt;a href=&#34;https://www.aldolat.it/posts/2019/wordpress-syntaxhighlighter-evolved-escaping/&#34;&gt;WordPress 5, SyntaxHighlighter Evolved e il carattere «&amp;»&lt;/a&gt; è uno scritto di &lt;a href=&#34;https://www.aldolat.it/&#34;&gt;aldolat.it&lt;/a&gt;. Rispettane le &lt;a href=&#34;https://www.aldolat.it/info/#licenza&#34;&gt;condizioni di licenza&lt;/a&gt;.&lt;/p&gt;</content:encoded>
        </item>
        <item>
            <title>You will not be bug free</title>
            <link>https://www.aldolat.it/posts/2011/quit-waiting/</link>
            <pubDate>Sat, 04 Jun 2011 22:35:21 +0000</pubDate>
            <author>aldolat@gmail.com (Aldo Latino)</author>
            <guid>https://www.aldolat.it/posts/2011/quit-waiting/</guid>
            <description>You will not be bug free.&#xA;So quit waiting until you’re perfect because you never will be.&#xA;Ship some damn code.&#xA;Brian Krogsgard, Quit waiting and ship code.&#xA;Come dire: non stare a guardare solo i tuoi limiti, ma comincia a scrivere codice.&#xA;Un bel pensiero di Brian Krogsgard (qui riporto solo uno stralcio), che vale un po&amp;rsquo; per il resto delle cose che facciamo.</description>
            <content:encoded>&lt;blockquote&gt;&#xA;&lt;p class=&#34;dch&#34;&gt;Y&lt;span class=&#34;allsc&#34;&gt;ou will&lt;/span&gt; not be bug free.&lt;/p&gt;&#xA;&lt;p&gt;So quit waiting until you’re perfect because you never will be.&lt;br&gt;&#xA;Ship some damn code.&lt;/p&gt;&#xA;&lt;p&gt;&lt;span class=&#34;sc&#34;&gt;Brian Krogsgard&lt;/span&gt;, &lt;em&gt;Quit waiting and ship code&lt;/em&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Come dire: non stare a guardare solo i tuoi limiti, ma comincia a scrivere codice.&lt;br&gt;&#xA;Un bel pensiero di Brian Krogsgard (qui riporto solo uno stralcio), che vale un po&amp;rsquo; per il resto delle cose che facciamo.&lt;/p&gt;&#xA;&lt;p&gt;L&#39;articolo &lt;a href=&#34;https://www.aldolat.it/posts/2011/quit-waiting/&#34;&gt;You will not be bug free&lt;/a&gt; è uno scritto di &lt;a href=&#34;https://www.aldolat.it/&#34;&gt;aldolat.it&lt;/a&gt;. Rispettane le &lt;a href=&#34;https://www.aldolat.it/info/#licenza&#34;&gt;condizioni di licenza&lt;/a&gt;.&lt;/p&gt;</content:encoded>
        </item>
        <item>
            <title>WordPress snippets in Geany</title>
            <link>https://www.aldolat.it/posts/2009/wordpress-snippets-in-geany/</link>
            <pubDate>Sat, 22 Aug 2009 23:18:46 +0000</pubDate>
            <author>aldolat@gmail.com (Aldo Latino)</author>
            <guid>https://www.aldolat.it/posts/2009/wordpress-snippets-in-geany/</guid>
            <description>Sarebbe utilissimo avere molti snippet di WordPress in Geany, l&amp;rsquo;editor che uso quando scrivo qualche riga di PHP. E siccome ne apprezzo l&amp;rsquo;immenso aiuto, mi sa che, quando ne avrò una raccolta discreta e spero di buona qualità, la rilascio per tutti. 🙂</description>
            <content:encoded>&lt;p&gt;Sarebbe utilissimo avere molti snippet di WordPress in &lt;a href=&#34;http://www.geany.org/&#34;&gt;Geany&lt;/a&gt;, l&amp;rsquo;editor che uso quando scrivo qualche riga di PHP. E siccome ne apprezzo l&amp;rsquo;immenso aiuto, mi sa che, quando ne avrò una raccolta discreta e spero di buona qualità, la rilascio per tutti. 🙂&lt;/p&gt;&#xA;&lt;p&gt;L&#39;articolo &lt;a href=&#34;https://www.aldolat.it/posts/2009/wordpress-snippets-in-geany/&#34;&gt;WordPress snippets in Geany&lt;/a&gt; è uno scritto di &lt;a href=&#34;https://www.aldolat.it/&#34;&gt;aldolat.it&lt;/a&gt;. Rispettane le &lt;a href=&#34;https://www.aldolat.it/info/#licenza&#34;&gt;condizioni di licenza&lt;/a&gt;.&lt;/p&gt;</content:encoded>
        </item>
        <item>
            <title>Un badge Digg senza plugin</title>
            <link>https://www.aldolat.it/posts/2008/un-badge-digg-senza-plugin/</link>
            <pubDate>Sat, 31 May 2008 15:41:24 +0000</pubDate>
            <author>aldolat@gmail.com (Aldo Latino)</author>
            <guid>https://www.aldolat.it/posts/2008/un-badge-digg-senza-plugin/</guid>
            <description>Oggi ho aggiunto al blog il badge per segnalare gli articoli su Digg. Ho cercato un plugin che facesse questo lavoro, ma nella ricerca mi sono imbattuto in questo post: in sostanza come aggiungere Digg al proprio blog senza l&amp;rsquo;ausilio di alcun plugin. Ecco come fare.&#xA;Preparazione dei file Creiamo anzitutto il file che creerà il nostro badge Digg. Aprite Gedit e incollate queste righe:&#xA;&amp;lt;div class=&amp;#34;diggLink&amp;#34;&amp;gt; &amp;lt;script type=&amp;#34;text/javascript&amp;#34;&amp;gt; digg_url = &amp;#39;&amp;lt;?php the_permalink() ?&amp;gt;&amp;#39;; digg_title = &amp;#39;&amp;lt;?php the_title(); ?&amp;gt;&amp;#39;; //digg_topic = &amp;#39;TOPIC&amp;#39;; // replace TOPIC /* Use the output buffer to capture the text output from the_ID() rather than having it rendered to the page. */ digg_bodytext = &amp;#39;&amp;lt;?php ob_start(); the_ID(); $postID = ob_get_contents(); ob_end_clean(); /* Get the body of the post, remove HTML, remove carriage returns and line feeds, escape &amp;#39;s, return only the first 350 char. */ $postObj = get_post($postID, OBJECT); $body = strip_tags($postObj-&amp;gt;post_content); $body = str_replace(chr(10), &amp;#39;&amp;#39;, $body); $body = str_replace(chr(13), &amp;#39;&amp;#39;, $body); $body = addslashes($body); echo substr($body, 0, 350); ?&amp;gt;&amp;#39;; &amp;lt;/script&amp;gt; &amp;lt;script src=&amp;#34;http://digg.com/tools/diggthis.js&amp;#34; type=&amp;#34;text/javascript&amp;#34;&amp;gt; &amp;lt;/script&amp;gt; &amp;lt;/div&amp;gt; Salvate il file come digg.php e caricatelo nella cartella del vostro tema attuale sul vostro server.</description>
            <content:encoded>&lt;p&gt;Oggi ho aggiunto al blog il badge per segnalare gli articoli su Digg. Ho cercato un plugin che facesse questo lavoro, ma nella ricerca mi sono imbattuto in &lt;a href=&#34;http://www.kennycarlile.net/2007/08/25/add-a-digg-badge-to-wordpress-postspages/&#34;&gt;questo post&lt;/a&gt;: in sostanza come aggiungere Digg al proprio blog senza l&amp;rsquo;ausilio di alcun plugin. Ecco come fare.&lt;/p&gt;&#xA;&lt;h2 id=&#34;preparazione-dei-file&#34;&gt;Preparazione dei file&lt;/h2&gt;&#xA;&lt;p&gt;Creiamo anzitutto il file che creerà il nostro badge Digg. Aprite Gedit e incollate queste righe:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-php&#34; data-lang=&#34;php&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;div&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;class&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;diggLink&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;o&#34;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;script&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;type&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;text/javascript&amp;#34;&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;&amp;gt;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;digg_url&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;lt;?php the_permalink() ?&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;digg_title&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;lt;?php the_title(); ?&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;c1&#34;&gt;//digg_topic = &amp;#39;TOPIC&amp;#39;; // replace TOPIC&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cm&#34;&gt;/*&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cm&#34;&gt;        Use the output buffer to capture the text&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cm&#34;&gt;        output from the_ID() rather than having&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cm&#34;&gt;        it rendered to the page.&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;cm&#34;&gt;        */&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;nx&#34;&gt;digg_bodytext&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;lt;?php&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;            ob_start();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;            the_ID();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;            $postID = ob_get_contents();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;            ob_end_clean();&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;            /*&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;            Get the body of the post, remove HTML,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;            remove carriage returns and line feeds,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;s1&#34;&gt;            escape &amp;#39;&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;s&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;return&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;only&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;the&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;first&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;350&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;char&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;.&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;o&#34;&gt;*/&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nv&#34;&gt;$postObj&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;get_post&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$postID&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;OBJECT&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nv&#34;&gt;$body&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;strip_tags&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$postObj&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&#34;na&#34;&gt;post_content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nv&#34;&gt;$body&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;str_replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;chr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;10&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nv&#34;&gt;$body&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;str_replace&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;chr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;mi&#34;&gt;13&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;),&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;nv&#34;&gt;$body&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;addslashes&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;            &lt;span class=&#34;k&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;nx&#34;&gt;substr&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$body&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;350&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;        &lt;span class=&#34;cp&#34;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&amp;#39;;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;    &amp;lt;/script&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;    &amp;lt;script src=&amp;#34;http://digg.com/tools/diggthis.js&amp;#34;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;        type=&amp;#34;text/javascript&amp;#34;&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;    &amp;lt;/script&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;err&#34;&gt;&amp;lt;/div&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Salvate il file come &lt;code&gt;digg.php&lt;/code&gt; e caricatelo nella cartella del vostro tema attuale sul vostro server.&lt;/p&gt;&#xA;&lt;p&gt;Prelevate il file &lt;code&gt;style.css&lt;/code&gt; del vostro attuale tema, per dare uno stile al badge che inseriremo. Andate in fondo (o dove preferite) e scrivete:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-css&#34; data-lang=&#34;css&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;.&lt;/span&gt;&lt;span class=&#34;nc&#34;&gt;diggLink&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;{&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;float&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;kc&#34;&gt;right&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;margin-bottom&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;    &lt;span class=&#34;k&#34;&gt;margin-left&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;4&lt;/span&gt;&lt;span class=&#34;kt&#34;&gt;px&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;p&#34;&gt;}&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Salvate il file e caricatelo sul vostro server.&lt;/p&gt;&#xA;&lt;h2 id=&#34;modifica-dei-file-template&#34;&gt;Modifica dei file template&lt;/h2&gt;&#xA;&lt;p&gt;Ora dobbiamo indicare a WordPress dove far apparire il badge. In genere i file&#xA;da modificare sono &lt;code&gt;index.php&lt;/code&gt; (il file che si vede quando visita la home page),&#xA;&lt;code&gt;single.php&lt;/code&gt; (il file che si vede quando si visualizza il singolo articolo),&#xA;&lt;code&gt;page.php&lt;/code&gt; (il file quando si visualizzano le singole pagine, staccate dalla&#xA;sequenza temporale) e &lt;code&gt;archive.php&lt;/code&gt; (il file delle pagine archivio).&lt;/p&gt;&#xA;&lt;p&gt;Scaricate questi file in locale e apritene uno. Trovate la riga che contiene&#xA;l&amp;rsquo;espressione &lt;code&gt;the_content&lt;/code&gt; e &lt;em&gt;subito prima&lt;/em&gt; (o subito dopo, a seconda di dove&#xA;preferite visualizzare il badge) inserite questa riga:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-php&#34; data-lang=&#34;php&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;o&#34;&gt;&amp;lt;?&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;php&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;include&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;nx&#34;&gt;TEMPLATEPATH&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;.&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;/digg.php&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;cp&#34;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&#34;err&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;È la riga che richiama le funzioni inserite in &lt;code&gt;digg.php&lt;/code&gt;. Salvate e chiudete.&#xA;Inserite questa riga in tutti e quattro i file di cui sopra o comunque in quelli&#xA;in cui volete che si visualizzi il badge. Caricate i file modificati nella&#xA;cartella del server.&lt;/p&gt;&#xA;&lt;p class=&#34;newpar&#34;&gt;Buon Digg!&lt;/p&gt;&#xA;&lt;p&gt;L&#39;articolo &lt;a href=&#34;https://www.aldolat.it/posts/2008/un-badge-digg-senza-plugin/&#34;&gt;Un badge Digg senza plugin&lt;/a&gt; è uno scritto di &lt;a href=&#34;https://www.aldolat.it/&#34;&gt;aldolat.it&lt;/a&gt;. Rispettane le &lt;a href=&#34;https://www.aldolat.it/info/#licenza&#34;&gt;condizioni di licenza&lt;/a&gt;.&lt;/p&gt;</content:encoded>
        </item>
        <item>
            <title>HTML, CSS e Wordpress Help Sheets</title>
            <link>https://www.aldolat.it/posts/2007/html-css-e-wordpress-help-sheets/</link>
            <pubDate>Tue, 11 Dec 2007 10:37:52 +0000</pubDate>
            <author>aldolat@gmail.com (Aldo Latino)</author>
            <guid>https://www.aldolat.it/posts/2007/html-css-e-wordpress-help-sheets/</guid>
            <description>Quante volte sarà capitato agli smanettoni del codice HTML, dei fogli stile (i CSS) e del codice PHP di WordPress di non ricordarsi la sintassi di quel particolare comando! A me, che non sono uno smanettone, è capitato tante volte. Ci ha pensato gosquared.com, che ha creato tre PDF con la sintassi dei comandi più comuni. Un ottimo strumento per chi modifica spesso codice. Ecco i link alle tre pagine:</description>
            <content:encoded>&lt;figure class=&#34;aligncenter&#34;&gt;&lt;img src=&#34;https://www.aldolat.it/images/2007/12/sheets_pdf.png&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&#xA;&lt;p&gt;Quante volte sarà capitato agli smanettoni del codice HTML, dei fogli stile (i CSS) e del codice PHP di WordPress di non ricordarsi la sintassi di quel particolare comando! A me, che non sono uno smanettone, è capitato tante volte. Ci ha pensato gosquared.com, che ha creato tre PDF con la sintassi dei comandi più comuni. Un ottimo strumento per chi modifica spesso codice. Ecco i link alle tre pagine:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://gosquared.com/liquidicity/archives/51&#34;&gt;HTML Help Sheet&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://gosquared.com/liquidicity/archives/33&#34;&gt;CSS Help Sheet&lt;/a&gt;&lt;/li&gt;&#xA;&lt;li&gt;&lt;a href=&#34;http://www.gosquared.com/liquidicity/archives/247&#34;&gt;WordPress Help Sheet&lt;/a&gt;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;L&#39;articolo &lt;a href=&#34;https://www.aldolat.it/posts/2007/html-css-e-wordpress-help-sheets/&#34;&gt;HTML, CSS e Wordpress Help Sheets&lt;/a&gt; è uno scritto di &lt;a href=&#34;https://www.aldolat.it/&#34;&gt;aldolat.it&lt;/a&gt;. Rispettane le &lt;a href=&#34;https://www.aldolat.it/info/#licenza&#34;&gt;condizioni di licenza&lt;/a&gt;.&lt;/p&gt;</content:encoded>
        </item>
    </channel>
</rss>
