<?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>Musings of ErisDS &#187; Wordpress</title> <atom:link href="http://erisds.co.uk/category/wordpress/feed" rel="self" type="application/rss+xml" /><link>http://erisds.co.uk</link> <description>Web development, Symfony, Wordpress and general geekery</description> <lastBuildDate>Tue, 19 Jan 2010 18:54:13 +0000</lastBuildDate> <generator>http://wordpress.org/?v=2.9.1</generator> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Snippet: Wordpress &#8211; Customise the Excerpt Length and More string</title><link>http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string</link> <comments>http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string#comments</comments> <pubDate>Fri, 15 Jan 2010 18:17:39 +0000</pubDate> <dc:creator>ErisDS</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[snippet]]></category> <category><![CDATA[web development]]></category><guid
isPermaLink="false">http://erisds.co.uk/?p=944</guid> <description><![CDATA[These functions and hooks let you customise the output of <kbd>the_excerpt()</kbd> template tag. Just copy and paste into the <kbd>functions.php</kbd> file in your theme. This works for both posts and pages.Related posts:<ol><li><a
href='http://erisds.co.uk/symfony/snippet-symfony-user-access-the-user-object' rel='bookmark' title='Permanent Link: Snippet: Symfony User &#8211; Access the User Object'>Snippet: Symfony User &#8211; Access the User Object</a> <small>The following snippets provide access to the Symfony User object...</small></li><li><a
href='http://erisds.co.uk/symfony/snippet-symfony-forms-setting-default-values' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Setting Default Values'>Snippet: Symfony Forms &#8211; Setting Default Values</a> <small>I often forget how to set default values for form...</small></li><li><a
href='http://erisds.co.uk/symfony/snippet-symfony-forms-allowing-extra-fields' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Allowing Extra Fields'>Snippet: Symfony Forms &#8211; Allowing Extra Fields</a> <small>Place this line of code in the configure method of...</small></li></ol>]]></description> <content:encoded><![CDATA[<p>These functions and hooks let you customise the output of <kbd>the_excerpt()</kbd> template tag. Just copy and paste into the <kbd>functions.php</kbd> file in your theme. This works for both posts and pages.</p><p>To change the excerpt length (how many words are output), define a function which returns the number you want and then call it with <kbd>add_filter()</kbd> on the &#8216;excerpt_length&#8217; filter as shown below.</p><div
class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table
cellspacing="0" cellpadding="0"><tbody><tr><td
style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br
/>2<br
/>3<br
/>4<br
/>5<br
/></div></td><td><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">function</span> custom_excerpt_length<span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$length</span><span
style="color: #009900;">&#41;</span><br
/> <span
style="color: #009900;">&#123;</span><br
/> <span
style="color: #b1b100;">return</span> <span
style="color: #cc66cc;">20</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #009900;">&#125;</span><br
/> add_filter<span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'excerpt_length'</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'custom_excerpt_length'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span></div></td></tr></tbody></table></div><p>By default excerpts which are generated by <strong>Wordpress</strong> (as opposed to defined via the &#8220;Excerpt&#8221; box) have the string &#8220;[...]&#8221; You might want to turn this into a link to the post or page and/or change the dots to something like &#8220;more&#8221;. The code below does both of these things using <kbd>str_replace()</kbd>.</p><div
class="codecolorer-container php twitlight" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><table
cellspacing="0" cellpadding="0"><tbody><tr><td
style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br
/>2<br
/>3<br
/>4<br
/>5<br
/>6<br
/></div></td><td><div
class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span
style="color: #000000; font-weight: bold;">function</span> custom_excerpt_more<span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$more</span><span
style="color: #009900;">&#41;</span><br
/> <span
style="color: #009900;">&#123;</span><br
/> <span
style="color: #000000; font-weight: bold;">global</span> <span
style="color: #000088;">$post</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #b1b100;">return</span> <a
href="http://www.php.net/str_replace"><span
style="color: #990000;">str_replace</span></a><span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'[...]'</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'&lt;a href=&quot;'</span><span
style="color: #339933;">.</span>get_permalink<span
style="color: #009900;">&#40;</span><span
style="color: #000088;">$post</span><span
style="color: #339933;">-&amp;</span>gt<span
style="color: #339933;">;</span>ID<span
style="color: #009900;">&#41;</span><span
style="color: #339933;">.</span><span
style="color: #0000ff;">'&quot;&gt;...read more...&lt;/a&gt;'</span><span
style="color: #339933;">,</span> <span
style="color: #000088;">$more</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span><br
/> <span
style="color: #009900;">&#125;</span><br
/> add_filter<span
style="color: #009900;">&#40;</span><span
style="color: #0000ff;">'excerpt_more'</span><span
style="color: #339933;">,</span> <span
style="color: #0000ff;">'custom_excerpt_more'</span><span
style="color: #009900;">&#41;</span><span
style="color: #339933;">;</span></div></td></tr></tbody></table></div><p>You can change the second parameter of <kbd>str_replace()</kbd> to whatever you want to be displayed. I included the <kbd>$post</kbd> global so that I could get the permalink and make the string into a link to the post/page.</p><p>Please note these will not work if you have any plugin installed which removes the excerpt hooks. One such plugin is the <a
href="http://wordpress.org/extend/plugins/event-calendar/">Event Calendar 3 plugin</a>. If you come across any more please let me know in the comments.</p><p
class="small"><strong>A Note on Snippets:</strong> When customising a CMS such as Wordpress it is often the simplest pieces of code which are the hardest to either find or remember. These snippets are placed here for my own reference and will hopefully be useful to others. If you find them useful or have any suggestions, please let me know.</p><p>Related posts:<ol><li><a
href='http://erisds.co.uk/symfony/snippet-symfony-user-access-the-user-object' rel='bookmark' title='Permanent Link: Snippet: Symfony User &#8211; Access the User Object'>Snippet: Symfony User &#8211; Access the User Object</a> <small>The following snippets provide access to the Symfony User object...</small></li><li><a
href='http://erisds.co.uk/symfony/snippet-symfony-forms-setting-default-values' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Setting Default Values'>Snippet: Symfony Forms &#8211; Setting Default Values</a> <small>I often forget how to set default values for form...</small></li><li><a
href='http://erisds.co.uk/symfony/snippet-symfony-forms-allowing-extra-fields' rel='bookmark' title='Permanent Link: Snippet: Symfony Forms &#8211; Allowing Extra Fields'>Snippet: Symfony Forms &#8211; Allowing Extra Fields</a> <small>Place this line of code in the configure method of...</small></li></ol></p>]]></content:encoded> <wfw:commentRss>http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string/feed</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Spotlight: Wordpress Pods Plugin</title><link>http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin</link> <comments>http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin#comments</comments> <pubDate>Sun, 28 Jun 2009 22:09:02 +0000</pubDate> <dc:creator>ErisDS</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[cms]]></category> <category><![CDATA[featured]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[spotlight]]></category><guid
isPermaLink="false">http://erisds.co.uk/?p=507</guid> <description><![CDATA[<img
src="http://erisds.co.uk/wp-content/uploads/2009/06/pods-300x162.jpg" alt="Wordpress Pods CMS Plugin" title="Wordpress Pods CMS Plugin" width="300" height="162" class="align-right size-medium" />Have you ever needed to build a website which fit into the "Posts and Page" paradigm of Wordpress 95%, but also needed one or two bits of extra content? I often need to build sites that have a quote/testimonial or banner image tied to individual pages &#038; displayed in the template separately to <kbd>"the_content()"</kbd>. This is fine in Wordpress as long as it remains a one-to-one relationship as it can easily be achieved with <a
href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> (and check out the <a
href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a> plugin for handling this), but achieving a one-to-many or many-to-many relationship in Wordpress requires some more dramatic extension.Related posts:<ol><li><a
href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: Wordpress 2.8'>Wordpress 2.8</a> <small>Over the weekend I updated my blog to Wordpress 2.8....</small></li><li><a
href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: Wordpress &#8211; Customise the Excerpt Length and More string'>Snippet: Wordpress &#8211; Customise the Excerpt Length and More string</a> <small>These functions and hooks let you customise the output of...</small></li><li><a
href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a> <small>Generally, when I find something interesting I use twitter &...</small></li></ol>]]></description> <content:encoded><![CDATA[<p><img
class="align-right size-medium" title="Wordpress Pods CMS Plugin" src="http://erisds.co.uk/wp-content/uploads/2009/06/pods-300x162.jpg" alt="Wordpress Pods CMS Plugin" width="300" height="162" />Have you ever needed to build a website which fit into the &#8220;Posts &amp; Page&#8221; paradigm of Wordpress 95%, but also needed one or two bits of extra content? I often need to build sites that have a quote/testimonial or banner image tied to individual pages &amp; displayed in the template separately to <kbd>"the_content()"</kbd>. This is fine in Wordpress as long as it remains a one-to-one relationship as it can easily be achieved with <a
href="http://codex.wordpress.org/Using_Custom_Fields">custom fields</a> (and check out the <a
href="http://wordpress.org/extend/plugins/more-fields/">More Fields</a> plugin for handling this), but achieving a one-to-many or many-to-many relationship in Wordpress requires some more dramatic extension.</p><p>To my knowledge there are two plugins for doing this. <a
href="http://flutter.freshout.us/">Flutter</a> and <a
href="http://pods.uproot.us/">Pods</a>.</p><h3>Flutter</h3><p>I started out using Flutter as I hadn&#8217;t heard of Pods but found it to be clunky, buggy &amp; unintuitive. When editing a content type (or write panel) created by Flutter it looks as though you are in the Post or Page section depending on where you placed your new content type. This is confusing and unnecessary.</p><p>The data types provided with Flutter are quite extensive (it even includes a colour picker). However, Flutter&#8217;s image upload control is buggy and I have experienced Flutter jumping to the wrong page, crashing Firefox and losing data. All-in-all I found it to be hard to use, missing key features and lacking documentation which meant I needed something else.</p><h3>Pods</h3><p>In essence what Pods does is turn Wordpress into Drupal. It allows you to define your own content types with multiple fields for adding data so that you can use Wordpress&#8217; admin interface and templating system to manage whatever data you want, be it just additional testimonials, or a full-blown product database. It also allows you to define templates for displaying or listing data types &amp; to write helpers and filters to handle the entry and display of complex data.</p><p>Pods&#8217; integration into Wordpress is much cleaner, meaning that content editing is much more intuitive than in Flutter. The many options for configuring filters and helpers has lead to a slightly complex admin interface, but one that is still highly usable. Pods also has considerably more documentation than Flutter seems to, although it is still lacking in some areas.</p><p>For me, the key bit of functionality which has made me love Pods is the PICK data type. It is essentially a drop-down list control, but instead of requiring you to define the options, it allows you to choose to list out other Pods, or Wordpress objects such as Posts, Pages or Users. This means you can build relationships between your content items, and that you create blocks of content for your templates by linking pods to Posts or Pages.</p><p>One piece of functionality I needed but isn&#8217;t present is the ability to use a PICK to create a drop-down list of all Posts and Pages to choose one to link to. A PICK data type can currently only list out Pages OR Posts OR Users etc, but not both. It is also not possible to list out Attachments, despite them being stored in the same table as Posts and pages.</p><p><a
href="http://erisds.co.uk/wp-content/uploads/2009/06/pods-pick.jpg"><img
class="align-left" title="Pods PICK interface (modified)" src="http://erisds.co.uk/wp-content/uploads/2009/06/pods-pick.jpg" alt="Pods PICK interface (modified)" width="280" height="311" /></a>As I needed this functionality, I decided to implement it. I have added the ability to PICK from Attachments, Posts &amp; Pages, Posts &amp; Attachments, Pages &amp; Attachments, or Posts, Pages &amp; Attachments. Only two files were modified  (<kbd>manage_pods.php</kbd> to add options to the select, and <kbd>Pods.class.php</kbd> to extend the if/else and SQL statements to choose the right data).</p><p>If you would like to use my modified version of the Pods plugin, I have made it available for download. Please first download the <a
href="http://wordpress.org/extend/plugins/pods/">full Pods plugin</a> and install it. Then download the <a
href="http://erisds.co.uk/wp-content/uploads/2009/06/podsmodified.zip">podsmodified</a> and upload them to the <kbd>wp-content/plugins/pods/core</kbd> folder. I haven&#8217;t done much testing on them but it seems to work OK for me, please let me know if you have any issues &amp; I&#8217;ll endeavour to fix them.</p><p>So, with my extension, I have found Pods to be extremely useful in several projects. It is a very powerful and ultimately usable CMS solution. However, there are still a few areas where I feel it could be improved:</p><ul><li>The power of the PICK data type could be improved as explained above.</li><li>I also feel that PICKs could be further improved by allowing users to specify a simple &#8220;enum&#8221;-like data type</li><li>The documentation, although at extremely useful, could greatly benefit from more detail &amp; in-depth examples</li><li>The clunky image upload interface needs work</li><li>The interface is usable, but introduces new elements not present in Wordpress (namely famfamfam icon buttons) &#8211; by bringing at least the content-editing interface into line with the rest of Wordpress I believe this plugin will really come of age</li><li>There is currently no way to link to a Pod from a Post or Page without configuring the relationship from the Pod itself (it would be nice to be able to setup custom fields to select from Pods but not necessary as it can be done the other way around).</li><li>There appears to be a bug in the PICK &gt; Categories option</li></ul><p>In summary, I believe the <a
href="http://pods.uproot.us/">Pods plugin</a> to be superior to Flutter and have found it more able to suit my needs. The PICK field type, filters and helpers make for an extremely powerful and expressive CMS and Pods integrates neatly with CMS so as not to confuse editors or clients, which is a key concern. I highly recommend the <a
href="http://pods.uproot.us/">Pods plugin</a> and look forward to seeing it mature as it has truly enormous potential.</p><p>Download <a
href="http://erisds.co.uk/wp-content/uploads/2009/06/podsmodified.zip">Pods Modified</a>!</p><p>Related posts:<ol><li><a
href='http://erisds.co.uk/wordpress/wordpress-2-8' rel='bookmark' title='Permanent Link: Wordpress 2.8'>Wordpress 2.8</a> <small>Over the weekend I updated my blog to Wordpress 2.8....</small></li><li><a
href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: Wordpress &#8211; Customise the Excerpt Length and More string'>Snippet: Wordpress &#8211; Customise the Excerpt Length and More string</a> <small>These functions and hooks let you customise the output of...</small></li><li><a
href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a> <small>Generally, when I find something interesting I use twitter &...</small></li></ol></p>]]></content:encoded> <wfw:commentRss>http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin/feed</wfw:commentRss> <slash:comments>19</slash:comments> </item> <item><title>Wordpress 2.8</title><link>http://erisds.co.uk/wordpress/wordpress-2-8</link> <comments>http://erisds.co.uk/wordpress/wordpress-2-8#comments</comments> <pubDate>Sun, 14 Jun 2009 16:46:31 +0000</pubDate> <dc:creator>ErisDS</dc:creator> <category><![CDATA[Wordpress]]></category> <category><![CDATA[blog]]></category> <category><![CDATA[browsers]]></category> <category><![CDATA[plugins]]></category> <category><![CDATA[widgets]]></category><guid
isPermaLink="false">http://erisds.co.uk/?p=457</guid> <description><![CDATA[Over the weekend I updated my blog to <a
href="http://wordpress.org/development/2009/06/wordpress-28/">Wordpress 2.8</a>. It's been a <del
datetime="2009-06-14T18:06:37+00:00">relatively smooth process</del> <ins
datetime="2009-06-14T18:06:37+00:00">complete screw-up (see my comment at the bottom)</ins> although I lost my archive and recent post widgets as I had hacked them to be multiple instance. As they are now multiple instance anyway (hurrah) I was able to remove the extra code and get everything back working properly.Related posts:<ol><li><a
href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: Wordpress Pods Plugin'>Spotlight: Wordpress Pods Plugin</a> <small>Have you ever needed to build a website which fit...</small></li><li><a
href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: Wordpress &#8211; Customise the Excerpt Length and More string'>Snippet: Wordpress &#8211; Customise the Excerpt Length and More string</a> <small>These functions and hooks let you customise the output of...</small></li><li><a
href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a> <small>Generally, when I find something interesting I use twitter &...</small></li></ol>]]></description> <content:encoded><![CDATA[<p>Over the weekend I updated my blog to <a
href="http://wordpress.org/development/2009/06/wordpress-28/">Wordpress 2.8</a>. It&#8217;s been a <del
datetime="2009-06-14T18:06:37+00:00">relatively smooth process</del> <ins
datetime="2009-06-14T18:06:37+00:00">complete screw-up (see my comment at the bottom)</ins> although I lost my archive and recent post widgets as I had hacked them to be multiple instance. As they are now multiple instance anyway (hurrah) I was able to remove the extra code and get everything back working properly.</p><p>So far I haven&#8217;t taken too much time to dig around but I am definitely liking the new widgets interface. I have several different sidebars (for the homepage, footer, single page, page, etc) so not having to remember to save it and then switch sidebars to make multiple changes is much, much slicker. I&#8217;m really looking to experimenting with the <a
href="http://codex.wordpress.org/WordPress_Widgets_Api">new widgets API</a> as well &#8211; I&#8217;ve got a few ideas for widgets, but if anyone reading this has ideas feel free to shoot them at me :)</p><p>On the other hand, I really dislike the new plugins interface. Having them all in one long list without a clear indication of which ones are active or inactive is really confusing, especially when you use a lot of plugins like me! I much preferred the old design with sections, where all active plugins were at the top.</p><p>Has anyone else had problems with using the widgets interface in Firefox? At first I thought it was either my connection or my hosting, but it works fine in chrome, itjust freezes in Firefox, along with gmail. It&#8217;s very frustrating as although I love chrome, I really miss my delicious, evernote, firebug, and other plugins!</p><p><ins
datetime="2009-06-14T17:34:41+00:00">Update: Is it me or is tagging not working in Wordpress 2.8? I&#8217;m completely unable to add tags to this post!</ins><br
/> <ins
datetime="2009-06-14T18:50:32+00:00">Update 2: It wasn&#8217;t me, it was DB Cache. Apparently that plugin causes the tagging issue along with hyperdb another DB caching plugin. Hope it&#8217;s fixed soon, but for now I can disable whilst I edit and then re-enable &#8211; fiddly but workable!</ins></p><p>Related posts:<ol><li><a
href='http://erisds.co.uk/wordpress/spotlight-wordpress-pods-plugin' rel='bookmark' title='Permanent Link: Spotlight: Wordpress Pods Plugin'>Spotlight: Wordpress Pods Plugin</a> <small>Have you ever needed to build a website which fit...</small></li><li><a
href='http://erisds.co.uk/wordpress/snippet-wordpress-customise-the-excerpt-length-and-more-string' rel='bookmark' title='Permanent Link: Snippet: Wordpress &#8211; Customise the Excerpt Length and More string'>Snippet: Wordpress &#8211; Customise the Excerpt Length and More string</a> <small>These functions and hooks let you customise the output of...</small></li><li><a
href='http://erisds.co.uk/symfony/symfony-new-static-text-management-plugin' rel='bookmark' title='Permanent Link: Symfony: New Static Text Management Plugin'>Symfony: New Static Text Management Plugin</a> <small>Generally, when I find something interesting I use twitter &...</small></li></ol></p>]]></content:encoded> <wfw:commentRss>http://erisds.co.uk/wordpress/wordpress-2-8/feed</wfw:commentRss> <slash:comments>21</slash:comments> </item> </channel> </rss>
<!-- This site's performance optimized by W3 Total Cache. Dramatically improve the speed and reliability of your blog!

Learn more about our WordPress Plugins: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (user agent is rejected)
Database Caching 22/98 queries in 0.184 seconds using disk

Served from: DSX4001-21.guardiandns.com @ 2010-03-11 03:48:49 -->