<?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; Advent Calendar</title> <atom:link href="http://wpengineer.com/tag/advent-calendar/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=6562</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>New Ideas For 2010? Now It&#8217;s Your Turn!</title><link>http://wpengineer.com/new-ideas-for-2010-now-its-your-turn/</link> <comments>http://wpengineer.com/new-ideas-for-2010-now-its-your-turn/#comments</comments> <pubDate>Thu, 31 Dec 2009 15:33:35 +0000</pubDate> <dc:creator>Alex</dc:creator> <category><![CDATA[WPengineer Misc]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[Happy New Year]]></category> <category><![CDATA[Ideas]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1941</guid> <description><![CDATA[We wish all our readers a Happy, Successful and Healthy New Year! We hope you enjoyed WP Engineer 2009 and you will keep reading our blog in the common years! To make WP Engineer more interesting for you, we would like to hear from you, what you like to read on our blog! 2009 past [...]]]></description> <content:encoded><![CDATA[<p>We wish all our readers a Happy, Successful and Healthy New Year! We hope you enjoyed WP Engineer 2009 and you will keep reading our blog in the common years! To make WP Engineer more interesting for you, we would like to hear from you, what you like to read on our blog!<br
/> <span
id="more-1941"></span><br
/> 2009 past by very fast and the number of our daily visitors grew very fast too, thanks to everyone! For all your comments, ideas, suggestions, criticism and compliments. We greatly enjoyed providing you tips and tricks about WordPress. And we would greatly appreciate if you can provide us with new ideas and suggestions what we could write about in 2010. We like to have a user driven content - unique, new, interesting, helpful and informative posts, which the vast majority of our readers find useful and worth reading. So leave your ideas in our comment area and we will try to accomplish your wishes.</p><p>We also like to thank our sponsors and guest authors, if you like to be one of them, please <a
href="mailto:info@wpengineer.com" class="limailto">contact us</a> and we will get in touch with you. Also thanks to everyone that our Advent Calendar was a huge success! Without the help of our readers, guest authors and sponsors we wouldn 't have had such a success with it!</p><p>We wish everyone a Happy New Year!</p><p>Alex - Frank - Micha</p><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/exclude-category-from-turnoff-comments-automatically/" rel="bookmark" title="Permanent Link: Exclude A Category From Turn Off Comments Automatically" class="liinternal">Exclude A Category From Turn Off Comments Automatically</a></li><li><a
href="http://wpengineer.com/meet-you-at-wordcamp-germany-2010-in-berlin/" rel="bookmark" title="Permanent Link: Meet You At WordCamp Germany 2010 In Berlin!" class="liinternal">Meet You At WordCamp Germany 2010 In Berlin!</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><li><a
href="http://wpengineer.com/wordpress-admin-ui-ideas/" rel="bookmark" title="Permanent Link: WordPress Admin UI Ideas" class="liinternal">WordPress Admin UI Ideas</a></li><li><a
href="http://wpengineer.com/wordpress-useful-default-configuration-settings-via-plugin/" rel="bookmark" title="Permanent Link: WordPress: Useful Default Configuration Settings Via Plugin" class="liinternal">WordPress: Useful Default Configuration Settings Via Plugin</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/new-ideas-for-2010-now-its-your-turn/feed/</wfw:commentRss> <slash:comments>10</slash:comments> </item> <item><title>24th Door &#8211; The WPE Quit Smoking Widget</title><link>http://wpengineer.com/24th-door-the-wpe-quit-smoking-widget/</link> <comments>http://wpengineer.com/24th-door-the-wpe-quit-smoking-widget/#comments</comments> <pubDate>Thu, 24 Dec 2009 07:12:19 +0000</pubDate> <dc:creator>Michael</dc:creator> <category><![CDATA[WordPress Plugins]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[Widget]]></category> <category><![CDATA[Widget API]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1918</guid> <description><![CDATA[For the last door in our Advent Calendar I had something special in mind. This year is coming to an end and I'm sure some of our readers want to quit smoking next year. To support their goal, I created a WP Engineer Quit Smoking Widget. Here a screenshot of all setting possibilities: And this [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-24.jpg" alt="" title="WordPress-Christmas-24" width="600" height="400" class="aligncenter size-full wp-image-1902" />For the last door in our Advent Calendar I had something special in mind. This year is coming to an end and I'm sure some of our readers want to quit smoking next year. To support their goal, I created a WP Engineer Quit Smoking Widget. <img
src='http://wpengineer.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p><p><span
id="more-1918"></span><br
/> Here a screenshot of all setting possibilities:</p><p><img
src="http://wpengineer.com/blog/wp-content/uploads/quit-smoking-widget.png" alt="WP Engineer Quit Smoking Widget" title="WPengineer Quit Smoking Widget" width="510" height="432" class="aligncenter size-full wp-image-1919" /></p><p>And this is how it would look like on your blog:</p><p><img
src="http://wpengineer.com/blog/wp-content/uploads/widget-output.png" alt="WP Enigineer Quit Smoking Widget Output" title="WP Enigineer Quit Smoking Widget Output" width="290" height="97" class="aligncenter size-full wp-image-1920" /></p><p>Even though, this idea seemed to be easy to realize. It was a piece of work. I don't want you to be bored, so I'm not explaining the whole code, but I just want go in detail on some details, what I had to consider to make this Widget workable.</p><p>I check the date if it's valid ( 2009/02/30 doesn't exist). Then I had to avoid division by zero, if the Widget is active but doesn't include any values yet. For the correct formatting of the saved money depending on the language I used the WordPress function <strong>number_format_i18n</strong>:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$saved</span> <span style="color: #339933;">=</span> number_format_i18n<span style="color: #009900;">&#40;</span><span style="color: #000088;">$packs</span> <span style="color: #339933;">*</span> <span style="color: #000088;">$price</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>Unfortunately, there is no feature in WordPress, which displays the currencies correctly (but I guess, this is probably not necessary). Therefore, I added a field "Currency position" with the values "before" and "after", so that the currency will be displayed properly, depending on the country. The year field automatically displays the current year minus 5 years, so that the widget is also current in 100 years. <img
src='http://wpengineer.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br
/> The rest are fields for entering the text output before and after values.</p><h3>Installation</h3><p>Unzip file wpe_quit_smoking_widget.zip and copy it to wp-content/plugins/ , then activate it in your backend. After that the Widget will be available in your Widgets area.</p><p>Please Note: The Widget needs <strong>WordPress Version 2.8</strong> or higher, otherwise it won't be displayed.</p><h3>Download</h3><p>Download <a
href="http://wpengineer.com/?download=WP%20Engineer%20Quit%20Smoking%20Widget" class="liinternal">WPEngineer Quit Smoking Widget</a></p><p>Have fun with the Widget and good luck with your goal to stop smoking! The team of WP Engineer wish you all Happy Holidays!</p><p><img
src="http://wpengineer.com/blog/wp-content/uploads/merry-christmas-wpengineer.jpg" alt="" title="merry-christmas-wpengineer" width="368" height="280" class="aligncenter size-full wp-image-1935" /><br
/><hr
/><h3>Related posts:</h3><ul><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/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/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><li><a
href="http://wpengineer.com/deactivate-wordpress-default-widgets/" rel="bookmark" title="Permanent Link: Deactivate WordPress Default Widgets" class="liinternal">Deactivate WordPress Default 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/24th-door-the-wpe-quit-smoking-widget/feed/</wfw:commentRss> <slash:comments>8</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>About WordPress Post Thumbnail</title><link>http://wpengineer.com/about-wordpress-post-thumbnail/</link> <comments>http://wpengineer.com/about-wordpress-post-thumbnail/#comments</comments> <pubDate>Tue, 22 Dec 2009 07:03:45 +0000</pubDate> <dc:creator>Frank</dc:creator> <category><![CDATA[WordPress Tutorials]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Post Thumbnail]]></category> <category><![CDATA[template tag]]></category> <category><![CDATA[Theme]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[WP]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1925</guid> <description><![CDATA[This is a complement to our previous post The Ultimative Guide For the_post_thumbnail In WordPress 2.9. In WordPress Version 2.9 probably the most discussed feature is the post thumbnail. Important for this function, it is only working when it is explicitly enabled in the theme. This can be done with the following little snippet in [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-22.jpg" alt="" title="WordPress-Christmas-22" width="600" height="400" class="aligncenter size-full wp-image-1900" />This is a complement to our previous post <a
href="http://wpengineer.com/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>. In WordPress <a
href="http://codex.wordpress.org/Version_2.9" class="liwp">Version 2.9</a> probably the most discussed feature is the post thumbnail. Important for this function, it is only working when it is explicitly enabled in the theme. This can be done with the following little snippet in the functions.php of the theme: <code>add_theme_support('post-thumbnails');</code>.</p><p>But even with this feature you should check for the existence of the function and offer an alternative. Only then you can leave the user the freedom to choose which WordPress version he wants to use. The functions of extensions, plugins and themes should be checked for their existence, then the functionality of the theme is secured, even if a function is not available. Similarly should it be handled with post thumbnail.</p><p>I would like to show two suggestions for alternatives below, and I refer to the detailed article about the topic images in <a
href="http://wpengineer.com/easier-better-solutions-to-get-pictures-on-your-posts/" class="liinternal">Easier And Better Solutions To Get Pictures On Your Posts</a>.</p><p><span
id="more-1925"></span></p><p>After adding the following syntax in the <code>functions.php</code> of the themes, you have a Metabox in the posting or page area ready and can easily be used.</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>The output of the image is in the theme at the spot where it should appear, simply use the template tag: <code>the_post_thumbnail()</code>.</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> current_theme_supports<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post-thumbnails'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</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></pre></div></div><p>Important, if you work with additional markup, then you need a query, which checks, whether there is a thumbnail for the post. Otherwise, you have unnecessary markup, which has no content.</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_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;span class=&quot;my_image&quot;&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</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> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  &lt;/span&gt;
} ?&gt;</pre></div></div><p>To have an alternative for installations prior to WP 2.9, you can take different approaches. The two following examples are providing just ideas: either using the custom fields, field name is <code>post-image</code> ...</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;">'has_post_thumbnail'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> has_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// @param: array(height, width)</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$myimage</span> <span style="color: #339933;">=</span> get_post_meta<span style="color: #009900;">&#40;</span><span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'post-image'</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;">// via custom field</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$myimage</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;img class=&quot;wp-post-image&quot; src=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$postimage</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; alt=&quot;Post Iage&quot; /&gt;'</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p>... or in the example below, the first image from the photo library. You can find more about it <a
href="http://wpengineer.com/easier-better-solutions-to-get-pictures-on-your-posts/" class="liinternal">in a separate post</a>.</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;">'has_post_thumbnail'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> has_post_thumbnail<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// @param: array(height, width)</span>
<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #666666; font-style: italic;">// via mediathek</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> get_the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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;">'numberposts'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span> <span style="color: #666666; font-style: italic;">// show all -1</span>
                  <span style="color: #0000ff;">'post_status'</span>    <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'inherit'</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: #339933;">,</span>
                  <span style="color: #0000ff;">'order'</span>          <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'ASC'</span><span style="color: #339933;">,</span>
                  <span style="color: #0000ff;">'orderby'</span>        <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'menu_order ASC'</span>
                  <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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: #b1b100;">echo</span> wp_get_attachment_image<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$attachment_id</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div><p><strong>Check</strong> if the theme support the 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> current_theme_supports<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post-thumbnails'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #339933;">...</span></pre></div></div><p>In addition, you can check whether the theme supports the function and explicit use for posts (post) or pages (page). Very interesting, if you want to bring additional features in the post edit section of the back end, which is dependent on this feature within 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> current_theme_supports<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'post-thumbnails'</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: #009900;">&#123;</span>
  add_meta_box<span style="color: #009900;">&#40;</span> <span style="color: #339933;">...</span></pre></div></div><p>In this context, you can also integrate external files with new features.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">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;">'/my-post-thumbnail-function.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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/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/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/sticky-function-in-wordpress-27/" rel="bookmark" title="Permanent Link: Sticky Function in WordPress 2.7" class="liinternal">Sticky Function in WordPress 2.7</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/about-wordpress-post-thumbnail/feed/</wfw:commentRss> <slash:comments>22</slash:comments> </item> <item><title>Quick View on WordPress Settings</title><link>http://wpengineer.com/quick-view-on-wordpress-settings/</link> <comments>http://wpengineer.com/quick-view-on-wordpress-settings/#comments</comments> <pubDate>Mon, 21 Dec 2009 06:50:56 +0000</pubDate> <dc:creator>Frank</dc:creator> <category><![CDATA[WordPress Tutorials]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[backend]]></category> <category><![CDATA[options]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[WP]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1867</guid> <description><![CDATA[In all versions of WordPress, there is the possibility to view all settings within the admin area of WordPress, but a menu link doesn't exist. The page options.php enables to have a quick look at various options and also allows you to save settings. However, it must be said, WordPress stores more data in serialized [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-21.jpg" alt="WordPress-Christmas-18" title="WordPress-Christmas-18" width="600" height="400" class="aligncenter size-full wp-image-1896" />In all versions of WordPress, there is the possibility to view all settings within the admin area of WordPress, but a menu link doesn't exist. The page <code>options.php</code> enables to have a quick look at various options and also allows you to save settings.<br
/> However, it must be said, WordPress stores more data in serialized form, which also is a good thing, but those you can no longer edit on this page.</p><p><img
src="http://wpengineer.com/blog/wp-content/uploads/wp-options.png" alt="wp-options" title="wp-admin/options.php" width="450" height="365" class="aligncenter size-full wp-image-1868" /></p><p>Nonetheless, certainly worth a look and now and then a help to quickly look into the settings of the blog. Alternatively, the plugin <a
href="http://wordpress.org/extend/plugins/wp-developer-assistant/" class="liwp">WP Developer Assistant</a> can help here, because it also allows a glimpse into the serialized data.</p><p>Example-URL: http://example.com/wp-admin/options.php</p><p>Alternatively you can also add a menu link. Add the following snippet in to the <code>functions.php</code> of your theme or create a Plugin.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> all_settings_page<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	add_options_page<span style="color: #009900;">&#40;</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'All Settings'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'All Settings'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'administrator'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'options.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'admin_menu'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'all_settings_page'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/some-more-details-about-the-wp-sytem-health-plugin/" rel="bookmark" title="Permanent Link: Some More Details About The WP System Health Plugin" class="liinternal">Some More Details About The WP System Health Plugin</a></li><li><a
href="http://wpengineer.com/more-memory-for-wordpress-more-information-about-wordpress/" rel="bookmark" title="Permanent Link: More Memory For WordPress &#8211; More Information About WordPress" class="liinternal">More Memory For WordPress &#8211; More Information About WordPress</a></li><li><a
href="http://wpengineer.com/wordpress-3-multisite-settings/" rel="bookmark" title="Permanent Link: WordPress 3.0 Multisite Settings" class="liinternal">WordPress 3.0 Multisite Settings</a></li><li><a
href="http://wpengineer.com/wordpress-useful-default-configuration-settings-via-plugin/" rel="bookmark" title="Permanent Link: WordPress: Useful Default Configuration Settings Via Plugin" class="liinternal">WordPress: Useful Default Configuration Settings Via Plugin</a></li><li><a
href="http://wpengineer.com/new-screenshots-of-wordpress-3-0/" rel="bookmark" title="Permanent Link: New Screenshots Of WordPress 3.0" class="liinternal">New Screenshots Of WordPress 3.0</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/quick-view-on-wordpress-settings/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Optimize Syndication Frequenzy</title><link>http://wpengineer.com/optimize-syndication-frequenzy/</link> <comments>http://wpengineer.com/optimize-syndication-frequenzy/#comments</comments> <pubDate>Sun, 20 Dec 2009 06:42:04 +0000</pubDate> <dc:creator>Frank</dc:creator> <category><![CDATA[WordPress Tutorials]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[Feed]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[WP]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1905</guid> <description><![CDATA[Today a standard becomes 9 years old. But hardly ever noticed: The Syndication-Module 1.4.1 of RDF Site Summary 1.0. What is it good for? Apparently some of you publishing posts less than 10 times per day. Shame on you ... not! WordPress, however, assumes that you can not even stop, so write it in the [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-20.jpg" alt="WordPress-Christmas-20" title="WordPress-Christmas-20" width="600" height="400" class="aligncenter size-full wp-image-1898" />Today a standard becomes 9 years old. But hardly ever noticed: The <a
href="http://purl.org/rss/1.0/modules/syndication/" hreflang="en" class="liexternal">Syndication-Module 1.4.1 of RDF Site Summary 1.0</a>.</p><h4>What is it good for?</h4><p>Apparently some of you publishing posts less than 10 times per day. Shame on you ... not!<br
/> WordPress, however, assumes that you can not even stop, so write it in the RSS feed:</p><div
class="wp_syntax"><div
class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sy:updatePeriod<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>hourly<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sy:updatePeriod<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;sy:updateFrequency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/sy:updateFrequency<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div><p>In plain English: Every feed reader should check once an hour, if you finally wrote something again.</p><p>Anyone who wants to relieve his server from such a thing, can change that. In the <code>functions.php</code> you write this two lines:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'rss_update_period'</span><span style="color: #339933;">,</span>    <span style="color: #990000;">create_function</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'return &quot;daily&quot;;'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'rss_update_frequency'</span><span style="color: #339933;">,</span> <span style="color: #990000;">create_function</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'return 4;'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><p>A few feed reader keep it by that but other don't. But even if there is only one: You've saved a few resources that you can use somewhere else.</p><div
class="incontent"><h4>Guest Post</h4><p>This post is written by Thomas Scholz - <a
href="http://toscho.de/" class="liexternal">toscho.de</a> and is a post in our Advent Calendar on WP Engineer about WordPress.<br
/> Thank you very much from my part to <a
href="http://toscho.de/" class="liexternal">Thomas</a>.<br
/> If you also like to have your interesting post published on our website, please let us know on our contact page. Of course we will appreciate your contribution!</div><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/wordpress-database-repair-script-in-2-9/" rel="bookmark" title="Permanent Link: WordPress Database Repair Script In 2.9" class="liinternal">WordPress Database Repair Script In 2.9</a></li><li><a
href="http://wpengineer.com/about/" rel="bookmark" title="Permanent Link: About" class="liinternal">About</a></li><li><a
href="http://wpengineer.com/convert-content-pre-tag-html-code/" rel="bookmark" title="Permanent Link: Convert Content of Pre-Tags in HTML-Code" class="liinternal">Convert Content of Pre-Tags in HTML-Code</a></li><li><a
href="http://wpengineer.com/feed-for-drafts-plugin/" rel="bookmark" title="Permanent Link: Feed for Drafts (Plugin)" class="liinternal">Feed for Drafts (Plugin)</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/optimize-syndication-frequenzy/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Amazed By Such A Great Support And Feedback!</title><link>http://wpengineer.com/amazed-by-such-a-great-support-and-feedback/</link> <comments>http://wpengineer.com/amazed-by-such-a-great-support-and-feedback/#comments</comments> <pubDate>Sat, 19 Dec 2009 07:12:36 +0000</pubDate> <dc:creator>Alex</dc:creator> <category><![CDATA[WPengineer Misc]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[SEO Plugin for WordPress]]></category> <category><![CDATA[Sponsor]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1926</guid> <description><![CDATA[Today is our 19th day of our Advent Calendar and we just want to say thank you to our readers, who have given a great feedback to our tips on our Advent Calendar and we have quite a lot more people reading our blog since the start of our calendar, about 30% raise. We also [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-19.jpg" alt="WordPress-Christmas-19" title="WordPress-Christmas-19" width="600" height="400" class="aligncenter size-full wp-image-1897" />Today is our 19th day of our Advent Calendar and we just want to say thank you to our readers, who have given a great feedback to our tips on our Advent Calendar and we have quite a lot more people reading our blog since the start of our calendar, about 30% raise. We also like to thank for the big support of our sponsors, we are especially happy that our spots for ads are sold out for this month!</p><p>We are glad that our readers like our posts on WP Engineer and our sponsors recognizing the value of being displayed on WP Engineer. Just to get to know our sponsors a little bit better, we will introduce them shortly. We hope that you find the services and offers of our sponsors interesting and useful. All of them are WordPress or Design related, I guess a good fit for our readers:</p><p><img
src="http://wpengineer.com/blog/wp-content/uploads/wishlistmember.jpg" alt="wishlistmember" title="wishlistmember" width="450" height="258" class="aligncenter size-full wp-image-1356" /><br
/> <a
href="http://member.wishlistproducts.com/" class="liexternal">WishList Member</a> is a powerful membership script that can turn any WordPress blog into a full blown membership site. Very interesting, you have to check it out. WishList Member belongs to our loyal sponsors, we are very glad to have them and to provide our readers a great membership plugin.</p><hr
/><p><img
src="http://wpengineer.com/blog/wp-content/uploads/wpseo.jpg" alt="wpseo" title="wpseo" width="450" height="258" class="aligncenter size-full wp-image-1358" /><br
/> <a
href="http://wpseo.org" class="liexternal"> wpSEO</a> is a great Plugin for better SEO on your WordPress installation. Check it out and you will love it as Google will love your blog from now on. <img
src='http://wpengineer.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> Of course we are using it on WP Engineer too. WP 2.9 ready and with over 70 setting to optimize your blog.</p><hr
/><p><img
src="http://wpengineer.com/blog/wp-content/uploads/make-better-websites.jpg" alt="make-better-websites" title="make-better-websites" width="450" height="258" class="aligncenter size-full wp-image-1355" /><br
/> <a
href="http://www.makebetterwebsites.com/" class="liexternal">MakeBetterWebsites</a> is a great gallery with a fine selection of high quality websites. All websites are handpicked and most of them I have first seen on this website instead of the usual suspects, seen on many other websites over and over again. Only high quality websites are seen on this website.</p><hr
/><p><img
src="http://wpengineer.com/blog/wp-content/uploads/Pagelines-Themes.jpg" alt="Pagelines-Themes" title="Pagelines-Themes" width="449" height="335" class="aligncenter size-full wp-image-1929" />If you also want to have a great design for your website, just get a <a
href="http://www.pagelines.com/" class="liexternal">PageLines Theme</a>. They have superior themes for WordPress that make it simple for you to have an awesome, fully-featured website that is easy to set up and manage.</p><hr
/><p><img
src="http://wpengineer.com/blog/wp-content/uploads/wpseek-search.jpg" alt="wpseek-search" title="wpseek-search" width="450" height="391" class="aligncenter size-full wp-image-1928" />Originally <a
href="http://wpseek.com/" class="liexternal">wpseek.com</a> was built as some kind of gateway for the little Firefox plugin "<a
href="http://www.schloebe.de/firefox-extensions/wordpress-helper/#english" class="liexternal">WordPress Helper</a>" to handle all kinds of search requests.</p><p>You can add <a
href="http://wpseek.com" class="liexternal">wpseek.com</a> as a search engine in your favorite browser. Look at the upper right of your browser.</p><hr
/><p><img
src="http://wpengineer.com/blog/wp-content/uploads/wordpress-book.jpg" alt="wordpress-book" title="wordpress-book" width="450" height="471" class="aligncenter size-full wp-image-1927" />Do you still need something for Christmas or it's too late for shipping or you even want to make yourself a great gift? <a
href="http://digwp.com/book/" class="liexternal">Download this book</a>, a great handbook to become a Pro in WordPress! 400 Pages of Practical Information. A Lifetime Subscription, when you buy this <a
href="http://digwp.com/book/" class="liexternal">book</a>, you will instantly get the most current version. But also, you are getting a lifetime subscription to all updated (PDF) copies of the book. And lots of Code Samples!</p><hr
/><p><img
src="http://wpengineer.com/blog/wp-content/uploads/buckmaker-theme.jpg" alt="buckmaker-theme" title="buckmaker-theme" width="450" height="405" class="aligncenter size-full wp-image-1932" /><a
href="http://thebuckmaker.com/" class="liexternal">Here </a>you'll find some of the most beautiful, powerful and state of the art WordPress Themes available these days. <a
href="http://thebuckmaker.com/" class="liexternal">Their premium themes</a> are very easy to install, edit and customize. <a
href="http://thebuckmaker.com/" class="liexternal">They</a> assist you in their support forums and provide several tutorials to get you started.</p><h3>If you also interested to support our website, please go to <a
href="http://buysellads.com/buy/detail/3646" class="liexternal">BuySellAds.com</a> and promote your service or product on WP Engineer. Maybe not this month, but maybe next month we have a spot just for you available. <img
src='http://wpengineer.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></h3><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/last-day-to-vote-for-us-to-be-the-coolest-blog-powered-by-wordpress/" rel="bookmark" title="Permanent Link: Last Day To Vote For Us To Be The Coolest Blog Powered By WordPress" class="liinternal">Last Day To Vote For Us To Be 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/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-update-core/" rel="bookmark" title="Permanent Link: WordPress 2.7 Update Core" class="liinternal">WordPress 2.7 Update Core</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></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/amazed-by-such-a-great-support-and-feedback/feed/</wfw:commentRss> <slash:comments>2</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>Sort Posts With The Help Of Custom Fields</title><link>http://wpengineer.com/sort-posts-custom-fields/</link> <comments>http://wpengineer.com/sort-posts-custom-fields/#comments</comments> <pubDate>Thu, 17 Dec 2009 06:43:33 +0000</pubDate> <dc:creator>Alex</dc:creator> <category><![CDATA[WordPress Hacks]]></category> <category><![CDATA[Advent Calendar]]></category> <category><![CDATA[Custom Fields]]></category> <category><![CDATA[Sort]]></category><guid
isPermaLink="false">http://wpengineer.com/?p=1915</guid> <description><![CDATA[Quite often, a WordPress developer likes to have posts sorted according to a custom field. If you would write a SQL-statement, it would be quite complex, since you need to JOIN two database tables (wp_posts und wp_postmeta). But there is a much easier way, if you use the template tags provided by WordPress - in [...]]]></description> <content:encoded><![CDATA[<p><img
src="http://wpengineer.com/blog/wp-content/uploads/WordPress-Christmas-17.jpg" alt="WordPress-Christmas-17" title="WordPress-Christmas-17" width="600" height="400" class="aligncenter size-full wp-image-1895" />Quite often, a WordPress developer likes to have posts sorted according to a custom field. If you would write a SQL-statement, it would be quite complex, since you need to JOIN two database tables (wp_posts und wp_postmeta).</p><p>But there is a much easier way, if you use the template tags provided by WordPress - in our case we use the function query_posts. Below you can see an example, which includes a custom field in the query, and also sort the posts with the help of this custom field. A short, easy to understand code with effective result:</p><p><img
src="http://wpengineer.com/blog/wp-content/uploads/Bildschirmfoto-2009-12-04-um-21.49.05.png" alt="Bildschirmfoto 2009-12-04 um 21.49.05" title="Bildschirmfoto 2009-12-04 um 21.49.05" width="577" height="271" class="aligncenter size-full wp-image-1916" /></p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">query_posts<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'meta_key=my_day&amp;meta_compare=&lt;=&amp;meta_value=20&amp;orderby=meta_value&amp;order=DESC'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div><div
class="incontent"><h4>Guest Post</h4><p>This post is written by Sergej Müller <a
href="http://www.wpseo.org" class="liexternal">wpseo.org</a> and is a post in our Advent Calendar on WP Engineer about WordPress.<br
/> Thank you very much from my part to <a
href="http://www.wpseo.org" class="liexternal">Sergej</a>.<br
/> If you also like to have your interesting post published on our website, please let us know on our contact page. Of course we will appreciate your contribution!</div><hr
/><h3>Related posts:</h3><ul><li><a
href="http://wpengineer.com/custom-fields-in-your-feed/" rel="bookmark" title="Permanent Link: Custom Fields in your Feed" class="liinternal">Custom Fields in your Feed</a></li><li><a
href="http://wpengineer.com/display-private-posts-to-logged-in-users/" rel="bookmark" title="Permanent Link: Display Private Posts to Logged in Users" class="liinternal">Display Private Posts to Logged in Users</a></li><li><a
href="http://wpengineer.com/strange-things-with-sticky-posts/" rel="bookmark" title="Permanent Link: Strange Things With Sticky Posts" class="liinternal">Strange Things With Sticky Posts</a></li><li><a
href="http://wpengineer.com/wordpress-3-0-menu-update/" rel="bookmark" title="Permanent Link: WordPress 3.0 Menu Update" class="liinternal">WordPress 3.0 Menu Update</a></li><li><a
href="http://wpengineer.com/easy-way-for-advertisement-in-wordpress/" rel="bookmark" title="Permanent Link: Easy Way For Advertisement In WordPress" class="liinternal">Easy Way For Advertisement In WordPress</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/sort-posts-custom-fields/feed/</wfw:commentRss> <slash:comments>8</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> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Database Caching 68/125 queries in 0.410 seconds using disk
Object Caching 2866/3086 objects using disk

Served from: wpengineer.com @ 2010-07-29 13:37:41 -->