<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ilDavid &#187; wordpress</title>
	<atom:link href="http://www.ildavid.com/dblog/tag/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ildavid.com</link>
	<description>la mia cassetta degli attrezzi</description>
	<lastBuildDate>Fri, 12 Aug 2011 15:26:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Shortcode and custom quicktag</title>
		<link>http://www.ildavid.com/dblog/wordpress-2/2010-159/shortcode-and-custom-quicktag/</link>
		<comments>http://www.ildavid.com/dblog/wordpress-2/2010-159/shortcode-and-custom-quicktag/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 22:26:13 +0000</pubDate>
		<dc:creator>ilDavid</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.ildavid.com/?p=159</guid>
		<description><![CDATA[I was developing a WordPress custom theme for a client and I came across a small problem: the articles should have an introductory text other than the abstract (basic functionality of WP). In practice it was to include some text in a &#60;div&#62; with a specific class, and to avoid the customer having to remember [...]]]></description>
			<content:encoded><![CDATA[<p>I was developing a WordPress custom theme for a client and I came across a small problem: the articles should have an introductory text other than the abstract (basic functionality of WP). In practice it was to include some text in a <i>&lt;div&gt;</i> with a specific class, and to avoid the customer having to remember every time the correct syntax, I created a shortcode and a quicktag button on the bar of the text editor to allow him to do everything with a click.<br />
I recalled a post on the use of shortcode in WPrecipes, and so I went looking <a href="http://www.wprecipes.com/how-to-save-time-by-using-wordpress-shortcodes">for that article</a>, but then I stumbled on the problem of adding the quicktag button to the toolbar: all the results that I found was to edit a file of the basic installation of WordPress, and this would mean that an update of the platform would lose my changes. Until I found <a href="http://scribu.net/wordpress/right-way-to-add-custom-quicktags.html">this post</a> which explains how to add a button without changing the original file, with the creation of a plugin. But I prefer to have a theme related function, so that, once the theme is activated, everything would be available.<br />
So here is the code to get all this:</p>
<pre class="brush: php; title: ; notranslate">
function intro_shortcode( $atts, $content = null ) {
   return '&lt;div class=&quot;introtext&quot;&gt;' . $content . '&lt;/div&gt;';
}
add_shortcode('intro', 'intro_shortcode');

add_action('admin_print_scripts', 'my_custom_quicktags');
function my_custom_quicktags() {
	wp_enqueue_script(
		'my_custom_quicktags',
		get_bloginfo( 'template_url' ).'/js/custom-quicktags.js',
		array('quicktags')
	);
}
</pre>
<p>in the <em>functions.php</em> and the JavaScript is:</p>
<pre class="brush: jscript; title: ; notranslate">edButtons[edButtons.length] =
new edButton('ed_block'
,'intro'
,'[intro]'
,'[/intro]'
,''
);</pre>
<p>to put in <em>template_directory</em>/js/custom-quicktags.js</p>
<div align="right" style="float: right; padding: 5px 0px 0px 5px;"><a name="fb_share" type="button_count" share_url="http://www.ildavid.com/dblog/wordpress-2/2010-159/shortcode-and-custom-quicktag/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.ildavid.com/dblog/wordpress-2/2010-159/shortcode-and-custom-quicktag/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get top level category of a post WP function</title>
		<link>http://www.ildavid.com/dblog/programmazione-web/2010-142/get-top-level-category-of-a-post-wp-function/</link>
		<comments>http://www.ildavid.com/dblog/programmazione-web/2010-142/get-top-level-category-of-a-post-wp-function/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 14:14:04 +0000</pubDate>
		<dc:creator>ilDavid</dc:creator>
				<category><![CDATA[Programmazione Web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.ildavid.com/?p=142</guid>
		<description><![CDATA[Let&#8217;s say you have a post under a subcategory and you want to show only the top level category that is assigned to the post, you can use this function:]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have a post under a subcategory and you want to show only the top level category that is assigned to the post, you can use this function:</p>
<pre class="brush: php; title: ; notranslate">
function GetTopLevelCategory() {
    $category = get_the_category();
    $parent = $category[0]-&gt;category_parent;
    while($parent &gt; 0) {
        $idlevel = &amp;get_category($parent);
        $cat = $idlevel-&gt;cat_ID;
        $parent = $idlevel-&gt;parent;
    }
    $name = get_the_category_by_ID($cat);
    $link = get_category_link($cat);
    print('&lt;a href=&quot;'.$link.'&quot;&gt;'.$name.'&lt;/a&gt;');
}
</pre>
<div align="right" style="float: right; padding: 5px 0px 0px 5px;"><a name="fb_share" type="button_count" share_url="http://www.ildavid.com/dblog/programmazione-web/2010-142/get-top-level-category-of-a-post-wp-function/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.ildavid.com/dblog/programmazione-web/2010-142/get-top-level-category-of-a-post-wp-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Novità di WordPress 3.0</title>
		<link>http://www.ildavid.com/dblog/programmazione-web/2010-129/novita-di-wordpress-3-0/</link>
		<comments>http://www.ildavid.com/dblog/programmazione-web/2010-129/novita-di-wordpress-3-0/#comments</comments>
		<pubDate>Wed, 19 May 2010 13:49:17 +0000</pubDate>
		<dc:creator>ilDavid</dc:creator>
				<category><![CDATA[Programmazione Web]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.ildavid.com/?p=129</guid>
		<description><![CDATA[SixRevisions ha pubblicato una guida sulle principali novità di WordPress 3.0, seguita oggi da una guida sull&#8217;utilizzo dei menù, realizzata da Templatic. Con questa nuova major release della piattaforma opensource si può tranquillamente affermare che WordPress è ormai un CMS a tutti gli effetti. Non è più solo un software per gestire blog, ma un [...]]]></description>
			<content:encoded><![CDATA[<p>SixRevisions ha pubblicato <a href="http://sixrevisions.com/wordpress/wordpress-3-0-guide/" target="_blank">una guida sulle principali novità di WordPress 3.0</a>, seguita oggi da una <a href="http://templatic.com/wordpress-tutorials/wordpress-3-0-menu-management">guida sull&#8217;utilizzo dei menù</a>, realizzata da Templatic.</p>
<p>Con questa nuova major release della piattaforma opensource si può tranquillamente affermare che WordPress è ormai un CMS a tutti gli effetti. Non è più solo un software per gestire blog, ma un vero e proprio (anche se per alcune cose non ancora completo) gestore di contenuti per qualsiasi tipo di sito web.</p>
<p>È importante infatti la novità della gestione dei post-type che permette di gestire diverse tipologi di contenuti del sito: in sostanza non ci sono più solo post e pagine ma ci potranno essere contenuti di qualsiasi tipo (personalizzati), per gestire per esempio un e-commerce o un portfolio&#8230; Uno sviluppatore russo lo spiega molto bene <a href="http://kovshenin.com/archives/extending-custom-post-types-in-wordpress-3-0/" target="_blank">in questo post</a>.</p>
<p>La gestione dei menù è un&#8217;altra delle ottime nuove features di WordPress 3.0, che era già in parte presente nella versione 2.9. Ora è possibile tramite una comoda interfaccia grafica, realizzare menu personalizzati per includere pagine, post, categorie o altri contenuti interni od esterni al sito. Questo risulta molto conveniente quando il sito avrà modifiche successive allo sviluppo del template, o se c&#8217;è bisogno di aggiornare frequentemente le voci di menu.</p>
<p>Le altre novità come il nuovo pannello di registrazione, l&#8217;integrazione con WordPress μ (multi user), la personalizzazione di testata e sfondo (tema 2010) sono altrettanto importanti, e magari ne scriverò più avanti, quando le avrò provate con mano.</p>
<div align="right" style="float: right; padding: 5px 0px 0px 5px;"><a name="fb_share" type="button_count" share_url="http://www.ildavid.com/dblog/programmazione-web/2010-129/novita-di-wordpress-3-0/"></a></div>]]></content:encoded>
			<wfw:commentRss>http://www.ildavid.com/dblog/programmazione-web/2010-129/novita-di-wordpress-3-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

