<?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>digitalnature &#187; Blog</title>
	<atom:link href="http://digitalnature.eu/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://digitalnature.eu</link>
	<description>Rise Above the Ordinary</description>
	<lastBuildDate>Wed, 16 May 2012 18:12:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>New plugin: Ad manager</title>
		<link>http://digitalnature.eu/blog/2012/05/08/new-plugin-ad-manager/</link>
		<comments>http://digitalnature.eu/blog/2012/05/08/new-plugin-ad-manager/#comments</comments>
		<pubDate>Tue, 08 May 2012 17:43:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[adsense]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=4131</guid>
		<description><![CDATA[It&#8217;s still under development, but the current version supports all functionality of the Ads mod from &#8220;Mystique&#8221; so you might as well use it instead of the mod  

Download on WordPress.org
Support Forums (post bug reports / requests here)

A quick screenshot:

In case you&#8217;re wondering if you will  [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s still under development, but the current version supports all functionality of the Ads mod from &#8220;Mystique&#8221; so you might as well use it instead of the mod <img src='http://digitalnature.eu/wp-content/themes/digitalnature/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<ul>
<li>Download on <a href="http://wordpress.org/extend/plugins/ad-manager-for-wp/" rel="external">WordPress.org</a></li>
<li><a title="Download" href="http://digitalnature.eu/forum/plugins/ad-manager/">Support Forums</a> (post bug reports / requests here)</li>
</ul>
<p>A quick screenshot:</p>
<p><a href="http://digitalnature.eu/wp-content/uploads/2012/05/screenshot-1.png"><img class="size-medium wp-image-4137 aligncenter" title="Ad Manager dashboard interface" src="http://digitalnature.eu/wp-content/uploads/2012/05/screenshot-1-300x238.png" alt="Ad Manager dashboard interface" width="300" height="238" /></a></p>
<p>In case you&#8217;re wondering if you will loose existing ads from the theme &#8211; no, they will be imported by the plugin.</p>
<p>For theme developers &#8211; to add &#8220;ad location&#8221; support in your theme, pass an action tag to the registerAdLocation() method. Example:</p>
<pre class="php">if(defined('AdManager::VERSION'))
  AdManager()-&gt;registerAdLocation('after_header', __('After theme header'));</pre>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2012/05/08/new-plugin-ad-manager/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Name suggestions?</title>
		<link>http://digitalnature.eu/blog/2012/02/24/name-suggestions/</link>
		<comments>http://digitalnature.eu/blog/2012/02/24/name-suggestions/#comments</comments>
		<pubDate>Fri, 24 Feb 2012 20:13:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=3472</guid>
		<description><![CDATA[So here are the first previews of the WP clone app I&#8217;ve been working on the past few weeks:
dev.digitalnature.eu/atom
That demo installation uses sqlite (a portable file database-system), that&#8217;s why the slowness and high number of queries (I&#8217;m practically forced to do 20 queries just to get the  [...]]]></description>
			<content:encoded><![CDATA[<p>So here are the first previews of the WP clone app I&#8217;ve been working on the past few weeks:</p>
<p><a href="http://dev.digitalnature.eu/atom/">dev.digitalnature.eu/atom</a></p>
<p>That demo installation uses sqlite (a portable file database-system), that&#8217;s why the slowness and high number of queries (I&#8217;m practically forced to do 20 queries just to get the database schema).</p>
<p>Nothing special on the surface because the API is far from complete. If you want to log in into the dashboard, use admin/admin credentials. There are no user access checks yet, so you can delete pretty much everything in there <img src='http://digitalnature.eu/wp-content/themes/digitalnature/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>To give you an idea of how far a developer can extend this application, take the dashboard as an example &#8211; it&#8217;s actually a plugin (here module).</p>
<p>Do you have any name suggestions for this application? Post them in the comments, I&#8217;m out of inspiration here. The &#8220;Atom&#8221; thing is just temporary&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2012/02/24/name-suggestions/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>4 GB free from Wuala</title>
		<link>http://digitalnature.eu/blog/2012/01/01/4-gb-free-from-wuala/</link>
		<comments>http://digitalnature.eu/blog/2012/01/01/4-gb-free-from-wuala/#comments</comments>
		<pubDate>Sun, 01 Jan 2012 18:13:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[storage]]></category>
		<category><![CDATA[useless stuff]]></category>
		<category><![CDATA[wuala]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=2780</guid>
		<description><![CDATA[Use this promo code and you get 4 GB of extra free space (valid for two years I think):
2012
And some older 1 GB promo codes you probably already know:
I-LIKE-POLAND
SKYFISH-IS-COOL
CONNECT-WITH-SUPPORT
Don&#8217;t know what Wuala is? Most of you are probably familiar with Dropbox, a popular online file  [...]]]></description>
			<content:encoded><![CDATA[<p>Use this promo code and you get 4 GB of extra free space (valid for two years I think):</p>
<pre>2012</pre>
<p>And some older 1 GB promo codes you probably already know:</p>
<pre>I-LIKE-POLAND
SKYFISH-IS-COOL
CONNECT-WITH-SUPPORT</pre>
<p>Don&#8217;t know what Wuala is? Most of you are probably familiar with Dropbox, a popular online file storage service. Wuala is one of its competitors, and in my opinion the best out there considering the features it provides.</p>
<p>If you want to get an account and start off with 3 GB, you can use <a href="http://www.wuala.com/referral/NPJM36PH353CFB47B546">my invite code</a> when signing up <img src='http://digitalnature.eu/wp-content/themes/digitalnature/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2012/01/01/4-gb-free-from-wuala/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>New WordPress clone</title>
		<link>http://digitalnature.eu/blog/2011/12/07/new-wordpress-clone/</link>
		<comments>http://digitalnature.eu/blog/2011/12/07/new-wordpress-clone/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 03:37:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=2524</guid>
		<description><![CDATA[If you&#8217;re wondering why the WP theme development is moving on so slow, it&#8217;s because I started working on a MVC-style  WP clone application, and this is currently taking most of my time.
Why? The main reason is simply because I love WordPress, and I&#8217;m starting to feel its limits. Leaving aside the  [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re wondering why the WP theme development is moving on so slow, it&#8217;s because I started working on a MVC-style  WP clone application, and this is currently taking most of my time.</p>
<p>Why? The main reason is simply because I love WordPress, and I&#8217;m starting to feel its limits. Leaving aside the fact that you&#8217;re forced to work with outdated technology, there&#8217;s simply no way to implement certain functionality without resorting to all sorts of ugly hacks. These hacks can break compatibility with plugins, slow the site or just &#8230;be ugly. The second reason is my desire to learn PHP better.</p>
<p>Right now, less than 20% of the app is complete, which is:</p>
<ul>
<li>the database API, which uses the PDO abstraction layer, so multiple database types are supported by default, not just mysql; also all write operations are wrapped within transactions &#8211; that means no db inconsistency issues when dealing with heavy traffic. The table structure differs from the one in WP and seems to be much faster from a few quick tests I made so far.</li>
<li>the option API (the same type of functionality as in WP)</li>
<li>internationalization API, about 4-5 times faster than WP&#8217;s, even when reading messages from PO files; all translations are handled by a single &#8220;t()&#8221;-named function, including plurals.</li>
<li>transient API (they get their own db table with an expiration column)</li>
<li>a basic cache handler, <del datetime="2012-02-08T21:02:36+00:00">for the moment it&#8217;s identical to WP&#8217;s object cache</del></li>
<li>action / filter API, almost the same as in WP</li>
<li>the User abstraction class (provides API for managing users)</li>
</ul>
<p>The plugin system is replaced by modules, which are basically objects on which the developer can attach events, instead of hooking functions to actions. Also options are very easy to manage from inside them since you get add/update/getOption inherited methods&#8230;</p>
<p>There&#8217;s no graphic interface so far, so no demo yet <img src='http://digitalnature.eu/wp-content/themes/digitalnature/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<h3>update: 08/02</h3>
<p>Finished cron (fake, like the one in WP), taxonomy and asset dependency APIs, and added XCache and APC cache extensions. I&#8217;ll be opening a repository for the source soon <img src='http://digitalnature.eu/wp-content/themes/digitalnature/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<h3>update: 17/02</h3>
<p>Finished controller (mapping URL routes to actions), along with some basic theming API. I don&#8217;t think I even need to compare this to WP&#8217;s rewrite-template system&#8230; An early demo and a Github repository should be up next week.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2011/12/07/new-wordpress-clone/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>New plugin: Post Ratings</title>
		<link>http://digitalnature.eu/blog/2011/11/21/new-plugin-post-ratings/</link>
		<comments>http://digitalnature.eu/blog/2011/11/21/new-plugin-post-ratings/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 21:08:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[post-ratings]]></category>
		<category><![CDATA[ratings]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=2417</guid>
		<description><![CDATA[Yet another post rating WordPress plugin  
What does it do:

Allow your site users to rate posts (of any kind)
Display the average post rating, vote count or weighted (bayesian) rating within your posts
Display a widget with the top rated posts in your sidebar

A few screenshots:




Download on  [...]]]></description>
			<content:encoded><![CDATA[<p>Yet another post rating WordPress plugin <img src='http://digitalnature.eu/wp-content/themes/digitalnature/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>What does it do:</p>
<ul>
<li>Allow your site users to rate posts (of any kind)</li>
<li>Display the average post rating, vote count or weighted (bayesian) rating within your posts</li>
<li>Display a widget with the top rated posts in your sidebar</li>
</ul>
<p>A few screenshots:</p>
<div class="clear-block">
<p><a href="http://digitalnature.eu/wp-content/uploads/2011/11/screenshot-11.png"><img class="alignleft size-thumbnail wp-image-2448" title="Plugin options" src="http://digitalnature.eu/wp-content/uploads/2011/11/screenshot-11-150x150.png" alt="Plugin options" width="150" height="150" /></a><a href="http://digitalnature.eu/wp-content/uploads/2011/11/screenshot-21.png"><img class="alignleft size-thumbnail wp-image-2422" title="Front-end rating links" src="http://digitalnature.eu/wp-content/uploads/2011/11/screenshot-21-150x150.png" alt="Front-end rating links" width="150" height="150" /></a><a href="http://digitalnature.eu/wp-content/uploads/2011/11/screenshot-3.png"><img class="size-thumbnail wp-image-2420 alignleft" title="&quot;Top Rated&quot; sidebar widget" src="http://digitalnature.eu/wp-content/uploads/2011/11/screenshot-3-150x150.png" alt="&quot;Top Rated&quot; sidebar widget" width="150" height="150" /></a><a href="http://digitalnature.eu/wp-content/uploads/2011/11/screenshot-4.png"><img class="alignleft size-thumbnail wp-image-2433" title="Atom version of the widget" src="http://digitalnature.eu/wp-content/uploads/2011/11/screenshot-4-150x150.png" alt="Atom version of the widget" width="150" height="150" /></a></p>
</div>
<ul>
<li>Download on <a href="http://wordpress.org/extend/plugins/post-ratings/" rel="external">WordPress.org</a></li>
<li><a href="http://digitalnature.eu/forum/plugins/post-ratings/">Support forums</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2011/11/21/new-plugin-post-ratings/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Featured images (thumbnails) in menus</title>
		<link>http://digitalnature.eu/blog/2011/10/27/featured-images-thumbnails-in-menus/</link>
		<comments>http://digitalnature.eu/blog/2011/10/27/featured-images-thumbnails-in-menus/#comments</comments>
		<pubDate>Thu, 27 Oct 2011 12:27:22 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Useless Stuff]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[menus]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=2215</guid>
		<description><![CDATA[The following code will let you use featured images as thumbnails in your custom menus. Paste this in your child theme functions.php file, or theme settings &#62; Advanced &#62; User-defined code:

atom()-&#62;setContextArgs('primary_menu', array('walker' =&#62; new ThumbMenuWalker()));

class ThumbMenuWalker  [...]]]></description>
			<content:encoded><![CDATA[<p>The following code will let you use featured images as thumbnails in your custom menus. Paste this in your child theme functions.php file, or theme settings &gt; Advanced &gt; User-defined code:</p>
<pre class="php">
atom()-&gt;setContextArgs('primary_menu', array('walker' =&gt; new ThumbMenuWalker()));

class ThumbMenuWalker extends AtomWalkerNavMenu{

  // register the thumbnail size, 64 pixel square, cropped
  function __construct(){
    add_image_size('nav-thumb', 64, 64, true);
  }

  // override start_el
  function start_el(&amp;$output, $item, $depth, $args) {

    $classes = empty($item-&gt;classes) ? array() : (array)$item-&gt;classes;

    $classes = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args));
    $classes = $classes ? ' class=&quot;'.esc_attr($classes).'&quot;' : '';

    $output .= &quot;\n&lt;li{$classes}&gt;&quot;;

    $attributes  = !empty($item-&gt;attr_title) ? ' title=&quot;'.esc_attr($item-&gt;attr_title).'&quot;' : '';
    $attributes .= !empty($item-&gt;target) ? ' target=&quot;'.esc_attr($item-&gt;target).'&quot;' : '';
    $attributes .= !empty($item-&gt;xfn) ? ' rel=&quot;'.esc_attr($item-&gt;xfn).'&quot;' : '';
    $attributes .= !empty($item-&gt;url) ? ' href=&quot;'.esc_attr($item-&gt;url).'&quot;' : '';

    $excerpt = $thumb = '';

    // 2nd level+
    if($depth &gt; 0){
      $post = new AtomObjectPost($item-&gt;object_id);

      // thumbnail image
      if(post_type_supports($item-&gt;object, 'thumbnail'))
        $thumb = $post-&gt;getThumbnail('nav-thumb');

    if($thumb)
      $attributes .= ' class=&quot;clear-block&quot;';

      // short description from the content, 100 is the max. character count
      $excerpt = $post-&gt;getContent(100, array(
        'cutoff'       =&gt; 'sentence',  // cut off just after the sentence ends
        'allowed_tags' =&gt; array(),     // no html
        'more'         =&gt; false,       // no 'more' text / link
      ));

      if($excerpt)
        $excerpt = &quot;&lt;small&gt;{$excerpt}&lt;/small&gt;&quot;;

      atom()-&gt;resetCurrentPost();
    }

    $content = $args-&gt;link_before.$thumb.'&lt;span class=&quot;tt&quot;&gt;'.apply_filters('the_title', $item-&gt;title, $item-&gt;ID).$excerpt.'&lt;/span&gt;'.$args-&gt;link_after;
    $output .= apply_filters('walker_nav_menu_start_el', &quot;{$args-&gt;before}&lt;a{$attributes}&gt;{$content}&lt;/a&gt;{$args-&gt;after}&quot;, $item, $depth, $args);
  }

}</pre>
<p>The CSS:</p>
<pre class="css">.nav img, .nav .no-img{
  float:left;
  margin-right: 5px;
} 

.nav .tt{
  overflow:hidden;
  display:block;
  font-weight:bold;
}  

.nav small{
  font-size:11px;
  display:block;
  margin-top: 5px;
}</pre>
<p>The result should be something like this:<br />
<img class="alignnone size-full wp-image-2216" title="Menu thumbanils" src="http://digitalnature.eu/wp-content/uploads/2011/10/thumb-menu.png" alt="Menu thumbanils" width="560" height="307" /></p>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2011/10/27/featured-images-thumbnails-in-menus/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
		<item>
		<title>Custom avatar images in WordPress</title>
		<link>http://digitalnature.eu/blog/2011/09/18/custom-avatar-images-in-wordpress/</link>
		<comments>http://digitalnature.eu/blog/2011/09/18/custom-avatar-images-in-wordpress/#comments</comments>
		<pubDate>Sun, 18 Sep 2011 23:28:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Useless Stuff]]></category>
		<category><![CDATA[avatars]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=1870</guid>
		<description><![CDATA[This is a short walktrough on how to let your website users upload their own avatars, without using a plugin.
First, define the maximum image sizes (note that we will only downsize, smaller images will get browser-resized):

define('MAX_AVATAR_WIDTH', 96);
define('MAX_AVATAR_HEIGHT', 96);

This  [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short walktrough on how to let your website users upload their own avatars, without using a plugin.</p>
<p>First, define the maximum image sizes (note that we will only downsize, smaller images will get browser-resized):</p>
<pre class="php">
define('MAX_AVATAR_WIDTH', 96);
define('MAX_AVATAR_HEIGHT', 96);
</pre>
<p>This goes in the child theme&#8217;s functions-user.php file.</p>
<p>Next, create the form which lets users upload the image. I chose the author.php template here, but you can easily add it inside the dashboard trough some hooks.</p>
<pre class="php">
&lt;?php if(is_user_logged_in() &amp;&amp; get_current_user_id() === (int)get_query_var('author')): ?&gt;
&lt;form method=&quot;POST&quot; enctype=&quot;multipart/form-data&quot; action=&quot;&quot;&gt;
  &lt;input type=&quot;file&quot; name=&quot;user_avatar&quot; /&gt;
  &lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;wp_handle_upload&quot; /&gt;
  &lt;input type=&quot;submit&quot; value=&quot;Upload new Avatar&quot; /&gt;
&lt;/form&gt;
&lt;?php endif; ?&gt;
</pre>
<p>The actual upload processing. You can have this in the same author template before get_header(), or inside the child theme&#8217;s functions:</p>
<pre class="php">
if(is_user_logged_in() &amp;&amp; isset($_FILES['user_avatar'])){

  // we need this for the wp_handle_upload function
  require_once ABSPATH.'wp-admin/includes/file.php';

  // ID of the current user
  $current_user_id = get_current_user_id();

  // just be aware that GIFs are annoying as fuck
  $allowed_image_types = array(
    'jpg|jpeg|jpe' =&gt; 'image/jpeg',
    'png'          =&gt; 'image/png',
    'gif'          =&gt; 'image/gif',
  );

  // let wp do the upload checks, file moving etc.
  $status = wp_handle_upload($_FILES['user_avatar'], array('mimes' =&gt; $allowed_image_types));

  // no errors? Get the uploaded file path and resize it
  if(empty($status['error'])){

    // resize it
    $resized = image_resize($status['file'], MAX_AVATAR_WIDTH, MAX_AVATAR_HEIGHT, $crop = true);

    // resize failed, display the reason
    if(is_wp_error($resized))
      wp_die($resized-&gt;get_error_message());

    // determine the resized file URL
    $uploads = wp_upload_dir();
    $resized_url = $uploads['url'].'/'.basename($resized);

    // insert the file URL into the current user meta
    update_user_meta($current_user_id, 'custom_avatar', $resized_url);

  // error, show it
  }else{
    wp_die(sprintf(__('Upload Error: %s'), $status['error']));

  }

}
</pre>
<p>Finally, hook into the avatar display function and get the avatar user meta field:</p>
<pre class="php">
add_filter('get_avatar', 'custom_avatars', 10, 3);

function custom_avatars($avatar, $id_or_email, $size){
  if(is_user_logged_in()){
    $current_user = wp_get_current_user();
    $image_url = get_user_meta($current_user-&gt;ID, 'custom_avatar', true);
    if($user_avatar !== false)
      return '&lt;img src=&quot;'.$image_url.'&quot; class=&quot;avatar photo&quot; width=&quot;'.$size.'&quot; height=&quot;'.$size.'&quot; alt=&quot;'.$current_user-&gt;display_name .'&quot; /&gt;';
  }

  return $avatar;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2011/09/18/custom-avatar-images-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>How to correctly hook your filter to the post content</title>
		<link>http://digitalnature.eu/blog/2011/09/12/how-to-correctly-hook-your-filter-to-the-post-content/</link>
		<comments>http://digitalnature.eu/blog/2011/09/12/how-to-correctly-hook-your-filter-to-the-post-content/#comments</comments>
		<pubDate>Mon, 12 Sep 2011 14:41:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[WordPress Plugins]]></category>
		<category><![CDATA[filters]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=1757</guid>
		<description><![CDATA[I&#8217;m seeing a lot of plugins that just hook themselves on the the_content filter tag, without bothering to handle excerpts.
Because get_the_excerpt() / the_excerpt() will call get_the_content() if the post doesn&#8217;t have an excerpt set, in many cases you get your filter applied on excerpts as well.  [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m seeing a lot of plugins that just hook themselves on the <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference/the_content" rel="external">the_content</a> filter tag, without bothering to handle excerpts.</p>
<p>Because get_the_excerpt() / the_excerpt() will call get_the_content() if the post doesn&#8217;t have an excerpt set, in many cases you get your filter applied on excerpts as well. This can lead to unwanted text inside them, like escaped javascript code.</p>
<p>If you don&#8217;t want your filter to be applied to excerpts, then remove it during the time in which the excerpt is being generated. Here&#8217;s one way to do it:</p>
<pre lang="php">
add_filter('the_content', 'my_plugin_filter');

// remove our filter, as early as possible
add_filter('get_the_excerpt', function($text){
  remove_filter('the_content', 'my_plugin_filter');
  return $text;
}, -999);

// add it back after wp_trim_excerpt was applied, in case the theme calls the_content after
add_filter('get_the_excerpt', function($text){
  add_filter('the_content', 'my_plugin_filter');
  return $text;
}, 999);
</pre>
<p>Another way is to check if the excerpt is being processed within your filter:</p>
<pre class="php">
add_filter('the_content', 'my_plugin_filter');

function my_plugin_filter($text){
  if(in_array('get_the_excerpt', $GLOBALS['wp_current_filter'])) return $text;

  // not the excerpt, do your stuff here...
  return $text;
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2011/09/12/how-to-correctly-hook-your-filter-to-the-post-content/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Translating Atom themes from the Dashboard</title>
		<link>http://digitalnature.eu/blog/2011/08/23/translating-atom-themes-from-the-dashboard/</link>
		<comments>http://digitalnature.eu/blog/2011/08/23/translating-atom-themes-from-the-dashboard/#comments</comments>
		<pubDate>Tue, 23 Aug 2011 22:54:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=1385</guid>
		<description><![CDATA[As the title says, this is a module that allows you to translate Atom themes from your WordPress Dashboard. The advantage over PoEdit is that the strings are automatically synchronized after theme updates (you don&#8217;t need to copy the theme files on your computer and set up paths anymore), and plural  [...]]]></description>
			<content:encoded><![CDATA[<p>As the title says, this is a module that allows you to translate Atom themes from your WordPress Dashboard. The advantage over <a href="http://www.poedit.net/" rel="external">PoEdit</a> is that the strings are automatically synchronized after theme updates (you don&#8217;t need to copy the theme files on your computer and set up paths anymore), and <a href="http://translate.sourceforge.net/wiki/l10n/pluralforms#plural_forms" rel="external">plural form definitions</a> are auto-detected based on your current site language.</p>
<p>Your translation will become active just after you push the save button (.mo and .po files are created in your child theme folder).</p>
<p><img src="http://digitalnature.eu/wp-content/uploads/2011/08/atom-translate.png" alt="Atom Translate module" title="Atom Translate module" width="689" height="543" class="aligncenter size-full wp-image-1386" /></p>
<p><del datetime="2011-08-25T08:35:03+00:00">Installation as usual, <a href="/download/atom-module-translate.zip">download</a> the archive and copy the module in your child theme &#8220;mods&#8221; directory.</del> (This is now included in the theme package)</p>
<p>I might port this to a plugin when I have the time, so that people can translate plugins or other themes too. Post your suggestions or encountered bugs in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2011/08/23/translating-atom-themes-from-the-dashboard/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Ajaxify your theme</title>
		<link>http://digitalnature.eu/blog/2011/08/12/ajaxify-your-theme/</link>
		<comments>http://digitalnature.eu/blog/2011/08/12/ajaxify-your-theme/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 17:16:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://digitalnature.eu/?p=1007</guid>
		<description><![CDATA[This is another module for Atom themes that intercepts clicks for most of the internal links, opens the linked page with Javascript and replaces relevant content into the current page.
Installation:
- download the module
- upload it into your child theme&#8217;s /mods/ folder, and activate it trough the  [...]]]></description>
			<content:encoded><![CDATA[<p>This is another module for Atom themes that intercepts clicks for most of the internal links, opens the linked page with Javascript and replaces relevant content into the current page.</p>
<p>Installation:<br />
- <a href="/download/atom-module-ajaxify.zip/">download</a> the module<br />
- upload it into your child theme&#8217;s /mods/ folder, and activate it trough the theme settings</p>
<p>You can see a demo on the <a href="http://wp.digitalnature.eu/mystique/">Mystique&#8217;s preview page</a></p>
<p>This will only work on browsers that support the new HTML 5 History API. That means all browsers, except Internet Explorer of course. IE users or users without javascript will navigate your site normally.</p>
<h3>Known Issues:</h3>
<ul>
<li>if you have any plugins that add javascript at some point in the page, then most likely they will not work well with this, because currently the module doesn&#8217;t inject javascript from the target page.</li>
<li>back/forward is not yet implemented. I&#8217;m working on it</li>
</ul>
<p>What&#8217;s the purpose of it? Apparently it decreases page load, by 20-40% from what I&#8217;ve seen so far&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://digitalnature.eu/blog/2011/08/12/ajaxify-your-theme/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
	</channel>
</rss>

