<?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>WP Engineer &#187; wp2.9</title> <atom:link href="http://wpengineer.com/tag/wp2-9/feed/" rel="self" type="application/rss+xml" /><link>http://wpengineer.com</link> <description>WordPress News, Hacks, Tipps, Tutorials, Plugins and Themes</description> <lastBuildDate>Wed, 28 Jul 2010 13:37:05 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=4928</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Display Post Thumbnail Also In Edit Post and Page Overview</title><link>http://wpengineer.com/display-post-thumbnail-post-page-overview/</link> <comments>http://wpengineer.com/display-post-thumbnail-post-page-overview/#comments</comments> <pubDate>Tue, 16 Feb 2010 10:51:49 +0000</pubDate> <dc:creator>Frank</dc:creator> <category><![CDATA[WordPress Hacks]]></category> <category><![CDATA[Post Thumbnail]]></category> <category><![CDATA[Theme]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[WP]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1960</guid> <description><![CDATA[WordPress version 2.9 introduced the function of Post Thumbnail. We wrote about this feature in this post and here and also in many other blogs. I find it an advantage, if the overview of articles and pages also provides the associated thumbnail. Therefore, I would like to introduce a small code snippet that makes just [...]]]></description> <content:encoded><![CDATA[<p>WordPress version 2.9 introduced the function of Post Thumbnail. We wrote about this feature <a
href="http://wpengineer.com/about-wordpress-post-thumbnail/" class="liinternal">in this post</a> and <a
href="http://wpengineer.com/wordpress-2-9-add_theme_support-and-has_post_image/" class="liinternal">here</a> and also in many other blogs. I find it an advantage, if the overview of articles and pages also provides the associated thumbnail. Therefore, I would like to introduce a small code snippet that makes just that.<br
/> <span
id="more-1960"></span></p><p><img
src="http://wpengineer.com/blog/wp-content/uploads/post-thumbnail-edit.png" alt="" title="post-thumbnail-edit" width="450" height="360" class="aligncenter size-full wp-image-1961" /></p><p>The above screenshot should illustrate what the little extension does. The following code must be put in a Plugin or be copied into the <code>functions.php</code> of the theme.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'fb_AddThumbColumn'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'add_theme_support'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// for post and page</span>
	add_theme_support<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post-thumbnails'</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'page'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> fb_AddThumbColumn<span style="color: #009900;">&#40;</span><span style="color: #000088;">$cols</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$cols</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'thumbnail'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Thumbnail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$cols</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> fb_AddThumbValue<span style="color: #009900;">&#40;</span><span style="color: #000088;">$column_name</span><span style="color: #339933;">,</span> <span style="color: #000088;">$post_id</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000088;">$width</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #cc66cc;">35</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$height</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #cc66cc;">35</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'thumbnail'</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$column_name</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #666666; font-style: italic;">// thumbnail of WP 2.9</span>
				<span style="color: #000088;">$thumbnail_id</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$post_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'_thumbnail_id'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #666666; font-style: italic;">// image from gallery</span>
				<span style="color: #000088;">$attachments</span> <span style="color: #339933;">=</span> get_children<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_parent'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$post_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'attachment'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post_mime_type'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'image'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumbnail_id</span><span style="color: #009900;">&#41;</span>
					<span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> wp_get_attachment_image<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$thumbnail_id</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span> <span style="color: #000088;">$height</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">elseif</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$attachments</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachments</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$attachment_id</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$attachment</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #000088;">$thumb</span> <span style="color: #339933;">=</span> wp_get_attachment_image<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachment_id</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span> <span style="color: #000088;">$height</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
				<span style="color: #009900;">&#125;</span>
					<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumb</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$thumb</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$thumb</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
						<span style="color: #b1b100;">echo</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'None'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// for posts</span>
	add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'manage_posts_columns'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fb_AddThumbColumn'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'manage_posts_custom_column'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fb_AddThumbValue'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// for pages</span>
	add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'manage_pages_columns'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fb_AddThumbColumn'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'manage_pages_custom_column'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'fb_AddThumbValue'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/new-feature-in-wordpress-2-9-the_post_image/" rel="bookmark" title="Permanent Link: New feature in WordPress 2.9 &#8211; the_post_image()" class="liinternal">New feature in WordPress 2.9 &#8211; the_post_image()</a></li><li><a
href="http://wpengineer.com/about-wordpress-post-thumbnail/" rel="bookmark" title="Permanent Link: About WordPress Post Thumbnail" class="liinternal">About WordPress Post Thumbnail</a></li><li><a
href="http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/" rel="bookmark" title="Permanent Link: The Ultimative Guide For the_post_thumbnail In WordPress 2.9" class="liinternal">The Ultimative Guide For the_post_thumbnail In WordPress 2.9</a></li><li><a
href="http://wpengineer.com/wordpress-2-9-add_theme_support-and-has_post_image/" rel="bookmark" title="Permanent Link: WordPress 2.9 add_theme_support and has_post_image" class="liinternal">WordPress 2.9 add_theme_support and has_post_image</a></li><li><a
href="http://wpengineer.com/display-always-subpages-in-sidebar/" rel="bookmark" title="Permanent Link: Display Always All Subpages in Sidebar" class="liinternal">Display Always All Subpages in Sidebar</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/display-post-thumbnail-post-page-overview/feed/</wfw:commentRss> <slash:comments>19</slash:comments> </item> <item><title>WordPress Widget-Areas with Description</title><link>http://wpengineer.com/wordpress-widget-areas-with-description/</link> <comments>http://wpengineer.com/wordpress-widget-areas-with-description/#comments</comments> <pubDate>Wed, 23 Dec 2009 07:12:09 +0000</pubDate> <dc:creator>Frank</dc:creator> <category><![CDATA[WordPress Tutorials]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[Theme]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[WP]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1871</guid> <description><![CDATA[Using WordPress version 2.9, there is now a possibility that we can write more detailed description for the widget areas. This is especially interesting when you define different widget areas, depending of categories or because the theme author defines various widget areas, that allows adjustments in more areas than just the sidebar. I do this [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-23.jpg" alt="" title="WordPress-Christmas-23" width="600" height="400" class="aligncenter size-full wp-image-1901" />Using WordPress version 2.9, there is now a possibility that we can write more detailed description for the widget areas. This is especially interesting when you define different widget areas, depending of categories or because the theme author defines various widget areas, that allows adjustments in more areas than just the sidebar. I do this for example in the theme Greyfoto, where the footer area is also equipped with widgets.<br
/> <span
id="more-1871"></span><br
/> In the following example code we define a widget area, called <em>My Lorem Ipsum Sidebar</em>, which contains &#8222;detailed&#8220; information.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'register_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Lorem Ipsum Sidebar'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'your_textdomain'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h2 class=&quot;widgettitle&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h2&gt;'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p><img
src="http://wpengineer.com/blog/wp-content/uploads/wp-widgets.png" alt="wp-widgets" title="wp-widgets" width="450" height="335" class="aligncenter size-full wp-image-1872" /></p><p>A more comprehensive example with two widget areas, one area for the sidebar and an area for the footer.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'register_sidebar'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'sidebar'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Lorem Ipsum Sidebar'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'your_textdomain'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h2 class=&quot;widgettitle&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h2&gt;'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    register_sidebar<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'id'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'footer'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'My Lorem Ipsum Footer'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&gt;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'your_textdomain'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;li id=&quot;%1$s&quot; class=&quot;widget %2$s&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_widget'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/li&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'before_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;h2 class=&quot;widgettitle&quot;&gt;'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'after_title'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/h2&gt;'</span><span style="color: #339933;">,</span>
    <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>This may be used as follows in the templates, it's being used in the <code>footer.php</code> of the widget area <em>My Lorem Ipsum Footer</em>.</p><div
class="wp_syntax"><div
class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;footer&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
        <span style="color: #009900;">&lt;?php dynamic_sidebar<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'footer'</span><span style="color: #66cc66;">&#41;</span>; ?&gt;</span>
    <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">ul</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/check-for-widgets-in-widget-areas/" rel="bookmark" title="Permanent Link: Check for Widgets in Widget-Areas" class="liinternal">Check for Widgets in Widget-Areas</a></li><li><a
href="http://wpengineer.com/advent-calendar-24-days-tips-and-tricks-each-day-today-wordpress-comment-form-widget/" rel="bookmark" title="Permanent Link: Advent Calendar &#8211; 24 Days Tips And Tricks Each Day! Today: WordPress Comment Form Widget" class="liinternal">Advent Calendar &#8211; 24 Days Tips And Tricks Each Day! Today: WordPress Comment Form Widget</a></li><li><a
href="http://wpengineer.com/wordpress-built-a-widget/" rel="bookmark" title="Permanent Link: Build A WordPress 2.8 Widget With The New Widget API" class="liinternal">Build A WordPress 2.8 Widget With The New Widget API</a></li><li><a
href="http://wpengineer.com/wordpress-28-widgets-options-page/" rel="bookmark" title="Permanent Link: WordPress 2.8 Widgets Options Page &#8211; First Screenshot!" class="liinternal">WordPress 2.8 Widgets Options Page &#8211; First Screenshot!</a></li><li><a
href="http://wpengineer.com/add-wordpress-dashboard-widgets/" rel="bookmark" title="Permanent Link: Add WordPress Dashboard Widgets" class="liinternal">Add WordPress Dashboard Widgets</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/wordpress-widget-areas-with-description/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>The Ultimative Guide For the_post_thumbnail In WordPress 2.9</title><link>http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/</link> <comments>http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/#comments</comments> <pubDate>Fri, 18 Dec 2009 06:50:48 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[WordPress Tutorials]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[template tag]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1930</guid> <description><![CDATA[WordPress 2.9 RC1 is released and the new post thumbnail function will not change until the final version hopefully. I was chatting a little bit with Sergej Müller last night and we were trying some things out. We found out the following things: Edit: Some little changes, see Matt's comment. You can provide 4 picture [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-18.jpg" alt="WordPress-Christmas-18" title="WordPress-Christmas-18" width="600" height="400" class="aligncenter size-full wp-image-1896" />WordPress 2.9 RC1 is released and the new post thumbnail function will not change until the final version hopefully.<br
/> I was chatting a little bit with <a
href="http://wpseo.org" title="wpSEO WordPress SEO Plugin" class="liexternal">Sergej Müller</a> last night and we were trying some things out. We found out the following things:<br
/> <span
id="more-1930"></span><br
/> <strong>Edit:</strong> Some little changes, see <a
href="http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/#comment-3053" class="liinternal">Matt's comment</a>.</p><p>You can provide 4 picture formats to the function (change the width and height values to your need):</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// the thumbnail </span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">// medium resolution</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">300</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// large resolution</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">600</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// original</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>You can set how the images should align. It is also possible to assign an own class:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">//  left align</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignleft'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  right align</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignright'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  center</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'aligncenter'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// align right and the class  'my_own_class'</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignright my_own_class'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>The 3rd possibility is the control of the images size with an array of height and width:<br
/> For this purpose we suppose that the settings for thumbnail is 150x150, for medium 300x200 and for large 600x400.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// thumbnail scaled to 60x60 pixel</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">60</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignleft'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
&nbsp;
<span style="color: #666666; font-style: italic;">// original thumbnail</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">150</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignleft'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// medium resolution scaled to 200x133 pixel</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">200</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignleft'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// large resolution scaled to 400x266 Pixel</span>
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">400</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">345</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignleft'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>We see that the image proportions are always maintained, even if one specifies crooked values.</p><p>For the Theme Designers is this not necessarily easier, because no one knows what the user will put in his settings o his library. One way to approach this problem, to query the options for the various sizes:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// width of the thumbnails</span>
get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail_size_w'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  height of the thumbnails</span>
get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail_size_h'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  height of the medium resolution</span>
get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'medium_size_h'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  width of the large resolution</span>
get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'large_size_w'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//  1 = Crop thumbnail to exact dimensions, 0 = Crop off</span>
get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail_crop'</span><span style="color: #009900;">&#41;</span></pre></div></div><p>You can change these values in your theme.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$w</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail_size_w'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$h</span> <span style="color: #339933;">=</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail_size_h'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">/</span><span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
&nbsp;
the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$w</span><span style="color: #339933;">,</span> <span style="color: #000088;">$h</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignleft'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Here another example: If the size of a thumbnail is bigger than 100x100 and crop is activated, then the thumbnail should be resized to 100x100, otherwise use the original thumbnail.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail_size_w'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">100</span> <span style="color: #339933;">&amp;&amp;</span> get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail_crop'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">100</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
    the_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thumbnail'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>Have fun with post thumbnails! But be aware, that each post thumbnail requires 2 data base queries. On a page with 10 posts that would be 20 more queries.<br
/><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/about-wordpress-post-thumbnail/" rel="bookmark" title="Permanent Link: About WordPress Post Thumbnail" class="liinternal">About WordPress Post Thumbnail</a></li><li><a
href="http://wpengineer.com/how-to-start-blogging/" rel="bookmark" title="Permanent Link: How To Start Blogging?" class="liinternal">How To Start Blogging?</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/the-ultimative-guide-for-the_post_thumbnail-in-wordpress-2-9/feed/</wfw:commentRss> <slash:comments>89</slash:comments> </item> <item><title>Extend the User Contact Info in WordPress 2.9</title><link>http://wpengineer.com/extend-user-contactinfo-wordpress-29/</link> <comments>http://wpengineer.com/extend-user-contactinfo-wordpress-29/#comments</comments> <pubDate>Wed, 16 Dec 2009 07:19:25 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[WordPress Hacks]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[template tag]]></category> <category><![CDATA[Theme]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1877</guid> <description><![CDATA[Joost de Valk wrote about a month ago a really great article about his idea, to expand the user contact fields (thanks Joost!). In version 2.9 you are able to use this possibility. Here a little example, how you can use this functionality. First you write your own function in your functions.php of your theme. [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-16.jpg" alt="WordPress-Christmas-16" title="WordPress-Christmas-16" width="600" height="400" class="aligncenter size-full wp-image-1894" /><br
/> <a
href="http://yoast.com" title="Tweaking Websites" class="liexternal">Joost de Valk</a> wrote about a month ago a <a
href="http://yoast.com/user-contact-fields-wp29/" title="User Contact Fields in WordPress 2.9" class="liexternal">really great article</a> about his idea, to expand the user contact fields (thanks Joost!). In version 2.9 you are able to use this possibility. Here a little example, how you can use this functionality.<br
/> <span
id="more-1877"></span><br
/> First you write your own function in your functions.php of your theme.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> my_new_contactmethods<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$contactmethods</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// Add Twitter</span>
  <span style="color: #000088;">$contactmethods</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'twitter'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Twitter'</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">//add Facebook</span>
  <span style="color: #000088;">$contactmethods</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'facebook'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Facebook'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$contactmethods</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'user_contactmethods'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'my_new_contactmethods'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">10</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p>This function does nothing more than expand the array $contactmethods with the fields twitter and facebook. The value behind the fields is used as a label for the input fields. You can also remove existing fields, here the field of YAHOO IM:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #666666; font-style: italic;">// Remove Yahoo IM</span>
  <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$contactmethods</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'yim'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p><img
src="http://wpengineer.com/blog/wp-content/uploads/wordpress-contact-info.png" alt="WordPress contact info edit screen" title="WordPress contact info edit screen" width="557" height="289" class="aligncenter size-full wp-image-1878" /></p><p>This fields can be displayed on the author page.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$current_author</span> <span style="color: #339933;">=</span> get_userdata<span style="color: #009900;">&#40;</span>get_query_var<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'author'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;p&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> esc_url<span style="color: #009900;">&#40;</span><span style="color: #000088;">$current_author</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">twitter</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Twitter&quot;&gt; Follow me on Twitter&lt;/a&gt;&lt;/p&gt;</pre></div></div><p>Alternatively you can also use the template tag the_author_meta.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">the_author_meta<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'facebook'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$current_author</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #009900;">&#41;</span></pre></div></div><p>That's all behind the 16ht door of our Advent Calendar. <img
src='http://wpengineer.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Have fun expanding your contact fields.</p><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/publish-the-feed-later/" rel="bookmark" title="Permanent Link: Publish The Feed Later" class="liinternal">Publish The Feed Later</a></li><li><a
href="http://wpengineer.com/list-all-users-in-wordpress/" rel="bookmark" title="Permanent Link: List All Users in WordPress" class="liinternal">List All Users in WordPress</a></li><li><a
href="http://wpengineer.com/disable-wordpress-feed/" rel="bookmark" title="Permanent Link: Disable WordPress Feed" class="liinternal">Disable WordPress Feed</a></li><li><a
href="http://wpengineer.com/a-chance-wordpress-plugin-competition/" rel="bookmark" title="Permanent Link: A Chance: WordPress Plugin Competition" class="liinternal">A Chance: WordPress Plugin Competition</a></li><li><a
href="http://wpengineer.com/wordpress-27-optimize-the-management/" rel="bookmark" title="Permanent Link: WordPress 2.7 Optimize The Management" class="liinternal">WordPress 2.7 Optimize The Management</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/extend-user-contactinfo-wordpress-29/feed/</wfw:commentRss> <slash:comments>19</slash:comments> </item> <item><title>Manage Multiple Excerpt Lengths</title><link>http://wpengineer.com/manage-multiple-excerpt-lengths/</link> <comments>http://wpengineer.com/manage-multiple-excerpt-lengths/#comments</comments> <pubDate>Thu, 10 Dec 2009 06:58:31 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[WordPress Hacks]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[template tag]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1909</guid> <description><![CDATA[Behind our 10th door of our Advent Calendar, we have a tip how to use multiple excerpt lengths. WordPress 2.9 allows you via filter to adjust excerpt more string and the length of the excerpt. But if you need several excerpt lengths for different templates, then what? Suppose we even need an excerpt of 30 [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-10.jpg" alt="WordPress-Christmas-10" title="WordPress-Christmas-10" width="600" height="400" class="aligncenter size-full wp-image-1888" />Behind our 10th door of our Advent Calendar, we have a tip how to use multiple excerpt lengths. WordPress 2.9 allows you via filter to adjust <a
href="http://wpengineer.com/wordpress-2-9-new-excerpt-filters/" title="New excerpt filters in WordPress 2.9" class="liinternal">excerpt more string</a> and the <a
href="http://wpengineer.com/wordpress-2-9-new-excerpt-filters/" title="New excerpt filters in WordPress 2.9" class="liinternal">length of the excerpt</a>. But if you need several excerpt lengths for different templates, then what?<br
/> <span
id="more-1909"></span><br
/> Suppose we even need an excerpt of 30 words, and once with 45 words and "..." as more string.<br
/> First, we write the filter functions with the required values.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> wpe_excerptlength_teaser<span style="color: #009900;">&#40;</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">45</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> wpe_excerptlength_index<span style="color: #009900;">&#40;</span><span style="color: #000088;">$length</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">function</span> wpe_excerptmore<span style="color: #009900;">&#40;</span><span style="color: #000088;">$more</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">'...'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>Now the new excerpt function.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> wpe_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$length_callback</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #000088;">$more_callback</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$length_callback</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'excerpt_length'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$length_callback</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$more_callback</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'excerpt_more'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$more_callback</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> get_the_excerpt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wptexturize'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'convert_chars'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$output</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$output</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>This function will be given the two filter functions. It will examine whether those features are available and if so, we applied the filter. Isn't there a length function, then WordPress applies the default value of 55 words. Thereafter, the excerpt will be taken. Then additional filters are applied (see default_filters.php). I haven't used the filter convert_smilies, it doesn't work with automatic excerpts anyways and I personally do not like wpautop because it comes with unpredictable results, especially in lists or code. That's why I wrapp the outputs with a clause.</p><p>Now we need the function in the template.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> wpe_excerpt<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wpe_excerptlength_index'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wpe_excerptmore'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
// the other one
<span style="color: #000000; font-weight: bold;">&lt;?php</span> wpe_excerpt<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wpe_excerptlength_teaser'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wpe_excerptmore'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p>Now, it makes no sense to write for any value of 1-55, a filter function <img
src='http://wpengineer.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , but for 2-3 different values in different views, the solution is useful.<br
/><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/wordpress-2-9-new-excerpt-filters/" rel="bookmark" title="Permanent Link: WordPress 2.9 new excerpt filters" class="liinternal">WordPress 2.9 new excerpt filters</a></li><li><a
href="http://wpengineer.com/wordpress-27-optimize-the-management/" rel="bookmark" title="Permanent Link: WordPress 2.7 Optimize The Management" class="liinternal">WordPress 2.7 Optimize The Management</a></li><li><a
href="http://wpengineer.com/plugin-review-codestyling-localization/" rel="bookmark" title="Permanent Link: Plugin Review: Codestyling Localization" class="liinternal">Plugin Review: Codestyling Localization</a></li><li><a
href="http://wpengineer.com/puplishing-extend-of-wordpress/" rel="bookmark" title="Permanent Link: Publishing Extend of WordPress" class="liinternal">Publishing Extend of WordPress</a></li><li><a
href="http://wpengineer.com/yaml-31-released/" rel="bookmark" title="Permanent Link: YAML 3.1 Released" class="liinternal">YAML 3.1 Released</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/manage-multiple-excerpt-lengths/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>Configure WordPress Trash</title><link>http://wpengineer.com/configure-wordpress-trash/</link> <comments>http://wpengineer.com/configure-wordpress-trash/#comments</comments> <pubDate>Mon, 07 Dec 2009 07:38:54 +0000</pubDate> <dc:creator>Frank</dc:creator> <category><![CDATA[WordPress Tutorials]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[backend]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[WP]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1874</guid> <description><![CDATA[Check out our 7th door of our Advent Calendar. WordPress Trash will have it's premiere in version 2.9. Now you can move every content, comment, post, pages, media and link to trash. It's quite the same function as you know from other online applications or operating systems. If you like to configure a special date [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-07.jpg" alt="WordPress-Christmas-07" title="WordPress-Christmas-07" width="600" height="400" class="aligncenter size-full wp-image-1885" />Check out our 7th door of our Advent Calendar.</p><p><a
href="http://wpengineer.com/wordpress-trash-is-coming/" class="liinternal">WordPress Trash</a> will have it's premiere in version 2.9. Now you can move every content, comment, post, pages, media and link to trash. It's quite the same function as you know from other online applications or operating systems.<br
/> <span
id="more-1874"></span><br
/> If you like to configure a special date of how long files should be kept in your trash, you can configure it in your wp-config.php.<br
/> <code>define( 'EMPTY_TRASH_DAYS', 10 );</code></p><p>The default settings deletes your content after 30 days. If you don't want to use trash at all, just use the value <code>0</code>.</p><p><code>define('EMPTY_TRASH_DAYS', 0);</code></p><p>Now there is no trash in your admin area available, and also no links to move files to your trash.<br
/><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/wordpress-trash-is-coming/" rel="bookmark" title="Permanent Link: WordPress Trash Is Coming" class="liinternal">WordPress Trash Is Coming</a></li><li><a
href="http://wpengineer.com/new-feature-for-wordpress-2-9-wordpress-image-editor/" rel="bookmark" title="Permanent Link: New Feature for WordPress 2.9 &#8211; WordPress Image Editor" class="liinternal">New Feature for WordPress 2.9 &#8211; WordPress Image Editor</a></li><li><a
href="http://wpengineer.com/wordpress-updates-via-ftp-on-windows-xampp-installations/" rel="bookmark" title="Permanent Link: WordPress Updates via FTP on Windows XAMPP installations" class="liinternal">WordPress Updates via FTP on Windows XAMPP installations</a></li><li><a
href="http://wpengineer.com/change-your-wordpress-backend/" rel="bookmark" title="Permanent Link: Change Your WordPress Backend" class="liinternal">Change Your WordPress Backend</a></li><li><a
href="http://wpengineer.com/add-links-to-wordpress-list-pages/" rel="bookmark" title="Permanent Link: Add Links To WordPress List Pages" class="liinternal">Add Links To WordPress List Pages</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/configure-wordpress-trash/feed/</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>2nd Door Of Our Advent Calendar &#8211; Support in WordPress for rel=&#8221;canonical&#8221;</title><link>http://wpengineer.com/support-in-wordpress-for-relcanonical/</link> <comments>http://wpengineer.com/support-in-wordpress-for-relcanonical/#comments</comments> <pubDate>Wed, 02 Dec 2009 07:05:32 +0000</pubDate> <dc:creator>Frank</dc:creator> <category><![CDATA[WordPress Hacks]]></category> <category><![CDATA[advent]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[SEO]]></category> <category><![CDATA[Theme]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1866</guid> <description><![CDATA[WordPress 2.9 will support the attribute rel and his value canonical, you can also read about it on an older post how to integrate the values and what's about it. Therefore you don't have to paste the HTML explicitly in your theme. In previous versions of WordPress 2.9, the intergration is easy to do: &#60;?php [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-02.jpg" alt="WordPress-Christmas-02" title="WordPress-Christmas-02" width="600" height="400" class="aligncenter size-full wp-image-1880" /><br
/> WordPress 2.9 will support the attribute <code>rel</code> and his value <code>canonical</code>, you can also read about it on <a
href="http://wpengineer.com/relcanonical-url-for-wordpress-theme/" class="liinternal">an older post</a> how to integrate the values and what's about it. Therefore you don't have to paste the HTML explicitly in your theme.</p><p>In previous versions of WordPress 2.9, the intergration is easy to do:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_singular<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;link rel=&quot;canonical&quot; href=&quot;'</span> <span style="color: #339933;">.</span> get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; /&gt;'</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p>Putting it in the header.php of the theme is the easiest way to have the link-tag in the <code>head</code> of your frontend.</p><p>Since WordPress 2.9 it won't be necessary because WordPress set with the help of the default filter, see <code>wp-includes/default-filters.php</code>, the <code>link</code>-tag to the hook <code>wp_head</code>.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rel_canonical'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Thereby it calls the function <code>rel_canonical()</code>, which simply writes the HTML and passes the link of the article. Alternatively you can disable the filter and you can use it yourself.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">remove_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_head'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rel_canonical'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// to delete in head</span></pre></div></div><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/wordpress-3-0-custom-background-support/" rel="bookmark" title="Permanent Link: WordPress 3.0 Custom Background Support" class="liinternal">WordPress 3.0 Custom Background Support</a></li><li><a
href="http://wpengineer.com/relcanonical-url-for-wordpress-theme/" rel="bookmark" title="Permanent Link: rel=&#8221;canonical&#8221;-URL for WordPress Theme" class="liinternal">rel=&#8221;canonical&#8221;-URL for WordPress Theme</a></li><li><a
href="http://wpengineer.com/we-made-it-on-the-list-of-the-coolest-blog-powered-by-wordpress/" rel="bookmark" title="Permanent Link: We Made It On The List Of The Coolest Blog Powered By WordPress" class="liinternal">We Made It On The List Of The Coolest Blog Powered By WordPress</a></li><li><a
href="http://wpengineer.com/your-support-is-much-appreciated/" rel="bookmark" title="Permanent Link: Your Support Is Much Appreciated !" class="liinternal">Your Support Is Much Appreciated !</a></li><li><a
href="http://wpengineer.com/amazed-by-such-a-great-support-and-feedback/" rel="bookmark" title="Permanent Link: Amazed By Such A Great Support And Feedback!" class="liinternal">Amazed By Such A Great Support And Feedback!</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/support-in-wordpress-for-relcanonical/feed/</wfw:commentRss> <slash:comments>2</slash:comments> </item> <item><title>WordPress Database Repair Script In 2.9</title><link>http://wpengineer.com/wordpress-database-repair-script-in-2-9/</link> <comments>http://wpengineer.com/wordpress-database-repair-script-in-2-9/#comments</comments> <pubDate>Fri, 13 Nov 2009 17:21:35 +0000</pubDate> <dc:creator>Frank</dc:creator> <category><![CDATA[WordPress News]]></category> <category><![CDATA[Constants]]></category> <category><![CDATA[sql]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1836</guid> <description><![CDATA[A little tip for all users of the existing beta of WordPress 2.9 and for all who wish to update soon to the new version. With version 2.9 WordPress conducts its own routine to optimize the database. Previously it was done by either Plugins or via SQL access. From the next version this function is [...]]]></description> <content:encoded><![CDATA[<p>A little tip for all users of the existing beta of WordPress 2.9 and for all who wish to update soon to the new version. With version 2.9 WordPress conducts its own routine to optimize the database. Previously it was done by either Plugins or via SQL access. From the next version this function is implemented in the core ...<br
/> <span
id="more-1836"></span><br
/> <a
href="http://wpengineer.com/blog/wp-content/uploads/wprdb11.png" class="liimagelink"><img
src="http://wpengineer.com/blog/wp-content/uploads/wprdb11-300x78.png" alt="wprdb1" title="wprdb1" width="300" height="78" class="aligncenter size-medium wp-image-1838" /></a></p><p>... which you can activate with the help of a constant; stored in <code>wp-config.php</code>, you have access to the script.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_ALLOW_REPAIR'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Call the script from the outside at the following address ...<br
/> <code>http://example.com/wp-admin/maint/repair.php</code></p><p>... where you either repair the database or run the optimization. Technically, there is no magic behind this work, but the familiar SQL statements <a
href="http://dev.mysql.com/doc/refman/5.1/en/analyze-table.html" class="liexternal"><code>ANALYZE TABLE</code></a>, <a
href="http://dev.mysql.com/doc/refman/5.1/en/repair-table.html" class="liexternal"><code>REPAIR TABLE</code></a> and <a
href="http://dev.mysql.com/doc/refman/5.1/en/optimize-table.html" class="liexternal"><code>OPTIMIZE TABLE</code></a>.</p><p><a
href="http://wpengineer.com/blog/wp-content/uploads/wprdb.png" class="liimagelink"><img
src="http://wpengineer.com/blog/wp-content/uploads/wprdb-300x127.png" alt="wprdb" title="wprdb" width="300" height="127" class="aligncenter size-medium wp-image-1841" /></a></p><p>I guess that will start a debate, why with the constant and why from the outside, etc. - leave your comment here. Alternatively, anyone can contribute to WordPress and discuss directly with the developers or enter changes directly to the code.<br
/><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/joomla-to-wordpress-content-converter/" rel="bookmark" title="Permanent Link: Joomla to WordPress &#8211; Content Converter!" class="liinternal">Joomla to WordPress &#8211; Content Converter!</a></li><li><a
href="http://wpengineer.com/joomla-fireboard-wordpress-wp-forum-converter/" rel="bookmark" title="Permanent Link: Joomla Fireboard to WordPress WP-FORUM Converter" class="liinternal">Joomla Fireboard to WordPress WP-FORUM Converter</a></li><li><a
href="http://wpengineer.com/use-constants-integrate-wordpress/" rel="bookmark" title="Permanent Link: Use Constants To Integrate WordPress In Other CMS" class="liinternal">Use Constants To Integrate WordPress In Other CMS</a></li><li><a
href="http://wpengineer.com/wordpress-database-functions/" rel="bookmark" title="Permanent Link: WordPress Database Functions" class="liinternal">WordPress Database Functions</a></li><li><a
href="http://wpengineer.com/wordpress-working-with-options/" rel="bookmark" title="Permanent Link: WordPress: Working With Options" class="liinternal">WordPress: Working With Options</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/wordpress-database-repair-script-in-2-9/feed/</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>WordPress 2.9 add_theme_support and has_post_image</title><link>http://wpengineer.com/wordpress-2-9-add_theme_support-and-has_post_image/</link> <comments>http://wpengineer.com/wordpress-2-9-add_theme_support-and-has_post_image/#comments</comments> <pubDate>Tue, 03 Nov 2009 21:16:55 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[WordPress News]]></category> <category><![CDATA[post_thumbnail]]></category> <category><![CDATA[Theme]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[WP]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1779</guid> <description><![CDATA[The new the_post_image functionality in WordPress version 2.9 has been enhanced. New is the wp-settings.php line // Load in support for template functions which the theme supports require_if_theme_supports&#40; 'post-thumbnails', ABSPATH . WPINC . '/post-image-template.php' &#41;; In functions.php it queries whether the theme supports post-thumbnail function: if &#40; function_exists&#40; 'add_theme_support' &#41; &#41; add_theme_support&#40; 'post-thumbnails' &#41;; If [...]]]></description> <content:encoded><![CDATA[<p>The new <a
href="http://wpengineer.com/new-feature-in-wordpress-2-9-the_post_image/" title="Article New feature in WordPress 2.9 – the_post_image()" class="liinternal"><strong> the_post_image</strong ></a> functionality in WordPress version 2.9 has been enhanced.<br
/> New is the wp-settings.php line<br
/> <span
id="more-1779"></span></p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Load in support for template functions which the theme supports</span>
require_if_theme_supports<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post-thumbnails'</span><span style="color: #339933;">,</span> ABSPATH <span style="color: #339933;">.</span> WPINC <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/post-image-template.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>In functions.php it queries whether the theme supports post-thumbnail function:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'add_theme_support'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
	add_theme_support<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post-thumbnails'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>If you look at the file wp-includes/post-image-template.php, there are 4 new features:</p><ul><li><strong>has_post_image()</strong></li><li><strong>get_post_image_id()</strong></li><li><strong>the_post_image()</strong></li><li><strong>get_the_post_image()</strong></li></ul><p>The theme itself can check within the loop, if the post has a Post-Thumbnail, and if so, then it can be output:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> has_post_image<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_post_image<span style="color: #009900;">&#40;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #cc66cc;">75</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">75</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'class'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'alignleft'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div><p>Those interested in more features and information should check the file in WordPress 2.9: <code>wp-includes/post-image-template.php</code><br
/> Especially the function: <code>get_the_post_image</code><br
/> It allows to adjust the output by using hooks.<br
/> In <code>get_the_post_image</code> the function <code>wp_get_attachment_image</code> get also used, what has been explained in detail in <a
href="http://wpengineer.com/easier-better-solutions-to-get-pictures-on-your-posts/" class="liinternal">this post just a few days ago</a>.</p><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/display-post-thumbnail-post-page-overview/" rel="bookmark" title="Permanent Link: Display Post Thumbnail Also In Edit Post and Page Overview" class="liinternal">Display Post Thumbnail Also In Edit Post and Page Overview</a></li><li><a
href="http://wpengineer.com/about-wordpress-post-thumbnail/" rel="bookmark" title="Permanent Link: About WordPress Post Thumbnail" class="liinternal">About WordPress Post Thumbnail</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/wordpress-2-9-add_theme_support-and-has_post_image/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Batch Plugin-Update in WordPress 2.9</title><link>http://wpengineer.com/batch-plugin-update-in-wordpress-2-9/</link> <comments>http://wpengineer.com/batch-plugin-update-in-wordpress-2-9/#comments</comments> <pubDate>Wed, 28 Oct 2009 10:58:37 +0000</pubDate> <dc:creator>Frank</dc:creator> <category><![CDATA[WordPress News]]></category> <category><![CDATA[Plugin]]></category> <category><![CDATA[update]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[wp2.9]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1766</guid> <description><![CDATA[In the past we have already informed you a little bit about the new features of the upcoming 2.9 version of WordPress - the development does not stop and the next version has many minor changes. Improvements in security, administration. WordPress 2.9 will have the possibility to update all your Plugins, which have an update [...]]]></description> <content:encoded><![CDATA[<p>In the past we have already informed you a little bit about the new features of the upcoming 2.9 version of WordPress - the development does not stop and the next version has many minor changes. Improvements in security, administration.</p><p>WordPress 2.9 will have the possibility to update all your Plugins, which have an update available, in one step.<br
/> That makes maintenance work with customer's and on your own blog more simple and faster. As a little insight, here is a screenshot of the current beta.</p><p><a
href="http://wpengineer.com/blog/wp-content/uploads/plugin-update-29.png" class="liimagelink"><img
src="http://wpengineer.com/blog/wp-content/uploads/plugin-update-29-300x291.png" alt="plugin-update-29" title="plugin-update-29" width="300" height="291" class="aligncenter size-medium wp-image-1767" /></a><br
/><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/warning-message-for-self-customized-plugins/" rel="bookmark" title="Permanent Link: Warning Message For Self Customized Plugins" class="liinternal">Warning Message For Self Customized Plugins</a></li><li><a
href="http://wpengineer.com/update-informations-only-for-admins/" rel="bookmark" title="Permanent Link: Update Informations Only for Admins" class="liinternal">Update Informations Only for Admins</a></li><li><a
href="http://wpengineer.com/use-wordpress-27-offline/" rel="bookmark" title="Permanent Link: Use WordPress 2.7 Offline" class="liinternal">Use WordPress 2.7 Offline</a></li><li><a
href="http://wpengineer.com/wordpress-updates-via-ftp-on-windows-xampp-installations/" rel="bookmark" title="Permanent Link: WordPress Updates via FTP on Windows XAMPP installations" class="liinternal">WordPress Updates via FTP on Windows XAMPP installations</a></li><li><a
href="http://wpengineer.com/wordpress-27-update-core/" rel="bookmark" title="Permanent Link: WordPress 2.7 Update Core" class="liinternal">WordPress 2.7 Update Core</a></li></ul><hr
/><p><img
style="float:left;" src="http://wpengineer.com/favicon.ico" alt="WP Engineer Favicon"/> Thanks for subscribing our feed! <a
href="http://buysellads.com/buy/detail/3646/" class="liexternal">Sponsor the WP Engineer Blog</a> and get your brand in front of several hundred users per day!<br
/> &copy; <a
href="http://wpengineer.com/" class="liinternal">WP Engineer Team</a>, All rights reserved <small>(Digital Fingerprint: WPEngineer-be0254ce2b4972feb4b9cb72034a092d)</small></p> ]]></content:encoded> <wfw:commentRss>http://wpengineer.com/batch-plugin-update-in-wordpress-2-9/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Database Caching 54/122 queries in 0.366 seconds using disk
Object Caching 2808/3017 objects using disk

Served from: wpengineer.com @ 2010-07-29 13:24:35 -->