<?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>lautr.com &#187; wordpress</title>
	<atom:link href="http://www.lautr.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lautr.com</link>
	<description>Hannes Blog for Development and Stuff besides</description>
	<lastBuildDate>Thu, 19 Jan 2012 17:58:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>zootool wordpress plugin</title>
		<link>http://www.lautr.com/zootool-wordpress-plugin/</link>
		<comments>http://www.lautr.com/zootool-wordpress-plugin/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 16:14:10 +0000</pubDate>
		<dc:creator>Hannes</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[badge]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[widget]]></category>
		<category><![CDATA[zootool]]></category>

		<guid isPermaLink="false">http://www.lautr.com/?p=219</guid>
		<description><![CDATA[I Took the Time to program a neat ZooTool Wordpress Plugin. For everyone out there who likes wordpress, zootool, badges and doesn't like to use to much extern Javascript on his Page this might be Something for you.  <a href="http://www.lautr.com/zootool-wordpress-plugin/">Weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I Took the Time to program a neat ZooTool WordPress Plugin. For everyone out there who likes wordpress, zootool, badges and doesn&#8217;t like to use to much extern Javascript on his Page this might be Something for you. You can find more Details on <a href="http://www.lautr.com/wordpress-zootool">my dedicated Page</a> .</p>
<p>Or if you&#8217;ve no Idea what I&#8217;m talking about check out <a href="http://zootool.com/user/justhannes/" target="_blank">zootool</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lautr.com/zootool-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding Menu and Option Points in WordPress Backend, different possibilities</title>
		<link>http://www.lautr.com/adding-menu-and-option-pages-in-wordpress-different-possibilities/</link>
		<comments>http://www.lautr.com/adding-menu-and-option-pages-in-wordpress-different-possibilities/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 12:00:31 +0000</pubDate>
		<dc:creator>Hannes</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[menu]]></category>
		<category><![CDATA[options]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wp]]></category>

		<guid isPermaLink="false">http://www.lautr.com/?p=81</guid>
		<description><![CDATA[There are different Ways to add Navigation Points to the WordPress Backend, most of them are explained here. Basically you have: add_options_page This will basically create another navigation Point under setting as most Plug-ins do. Its best suited for scenarios &#8230; <a href="http://www.lautr.com/adding-menu-and-option-pages-in-wordpress-different-possibilities/">Weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>There are different Ways to add Navigation Points to the WordPress Backend, <a href="http://codex.wordpress.org/Adding_Administration_Menus" target="_blank">most of them are explained here</a>. Basically you have:</p>
<h3>add_options_page</h3>
<p><a href="http://static.lautr.com/wp-content/uploads/2010/02/add_options_page.png"><img class="size-full wp-image-89 alignleft" title="add_options_page" src="http://static.lautr.com/wp-content/uploads/2010/02/add_options_page.png" alt="" width="150" height="270" /></a>This will basically create another navigation Point under setting as most Plug-ins do. Its best suited for scenarios where your Plug-in provides Options/Settings for your blog.</p>
<p>The Parameters are the following</p>
<ol>
<li>the Title you want to display in the Menu</li>
<li>the Title you want to display on the Page itself</li>
<li>the Userlevel required to see the Link</li>
<li>as the name says, a unique string,  basename(__FILE__) works just fine also</li>
<li>a callback function for the page it should lead to, you can use a simple function name (as string) or use an object and its method, as i did</li>
</ol>
<p>the syntax could look like:</p>
<pre class="brush: php">
add_options_page(&#039;Menu Title&#039;, &#039;Page Title&#039;, 9,&#039;an-uniq-string-as-key&#039;, array(&#039;wp_my_awesome_class&#039;,&#039;optionPage&#039;));
</pre>
<h3>add_submenu_page</h3>
<p><a href="http://static.lautr.com/wp-content/uploads/2010/02/add_submenu_page.png"><img class="alignleft size-full wp-image-90" title="add_submenu_page" src="http://static.lautr.com/wp-content/uploads/2010/02/add_submenu_page.png" alt="" width="150" height="270" /></a>As the Name suggests this function is used to add Sub Menus to any Main Option, besides and including what add_options_page does, why are there two different functions then? Lets say legacy Reason &#8211; yeah sounds fine.</p>
<p>As you may see, its basically the same, besides you need to give the unique-key of the parent you want to attend to, for the basics that would be:</p>
<p>For Write: add_submenu_page(&#8216;post-new.php&#8217;,&#8230;)<br />
For Manage: add_submenu_page(&#8216;edit.php&#8217;,&#8230;)<br />
For Design: add_submenu_page(&#8216;themes.php&#8217;,&#8230;)<br />
For Comments: add_submenu_page(&#8216;edit-comments.php&#8217;,&#8230;)<br />
For Settings: add_submenu_page(&#8216;options-general.php&#8217;,&#8230;)<br />
For Plugins: add_submenu_page(&#8216;plugins.php&#8217;,&#8230;)<br />
For Users: add_submenu_page(&#8216;users.php&#8217;,&#8230;)</p>
<p>Or, anything you set up as a Main-Menu-Point / Parent yourself.</p>
<p>And it, for an example, looks like:</p>
<pre class="brush: php">
add_submenu_page(&#039;an-uniq-string-as-key-of-the-parent&#039;,&#039;Page Title&#039;,&#039;Menu Title&#039;,9,&#039;an-uniq-string-as-key&#039;, array(&#039;wp_my_awesome_class&#039;,&#039;adminPage&#039;));
</pre>
<h3>add_menu_page</h3>
<p><a href="http://static.lautr.com/wp-content/uploads/2010/02/add_menu_page.png"><img class="alignleft size-full wp-image-87" title="add_menu_page" src="http://static.lautr.com/wp-content/uploads/2010/02/add_menu_page.png" alt="" width="150" height="270" /></a>And thats where the fun starts, with this nice function you can add a Main-Navigation-point to your menu.</p>
<p>The most stuff should be clear by now, the only difference is that you add a path to an icon you use. Well, isnt that just too nice to be true? Yes, yes it is, because you will notice that your Nice new so important Main Navigation Point will always appear on the very bottom of the Navigation.</p>
<p>So lets, see, in the End you can add Navigation Points to every Main Navigation Points (in the Bottom) and an Main Navigation Point itself, in the bottom.</p>
<p>the syntax could look like:</p>
<pre class="brush: php">
add_menu_page(&#039;Page Title&#039;, &#039;Main Title&#039;,4,&#039;an-uniq-string-as-key&#039;, array(&#039;wp_my_awesome_class&#039;,&#039;adminPage&#039;)),&#039;http://www.example.com/favicon.ico&#039;);
</pre>
<p><strong>Now, if you want to Add an Main Navigation Point on another Position it is possibile, but only in a not documented manner!</strong></p>
<h3>add_menu_page extended</h3>
<p>The Code is the same as for the regular use of add_menu_page, but in release 2.9 they added a new Parameter that can be used to choose the Position of the Entry:</p>
<pre class="brush: php">
add_menu_page(&#039;Page Title&#039;, &#039;Main Title&#039;,4,&#039;an-uniq-string-as-key&#039;, array(&#039;wp_my_awesome_class&#039;,&#039;adminPage&#039;)),&#039;http://www.example.com/favicon.ico&#039;,1);
</pre>
<p><a href="http://static.lautr.com/wp-content/uploads/2010/02/add_menu_page_2.png"><img class="alignleft size-full wp-image-88" title="add_menu_page_2" src="http://static.lautr.com/wp-content/uploads/2010/02/add_menu_page_2.png" alt="" width="150" height="270" /></a>This would then Appear on top, even before Dashboard. However, unfortunately  you can not just use every Position.</p>
<p>Since most of them are already taken by Existing Menu Points and Separators <strong>if you do so anyway you&#8217;ll overwrite them</strong>.</p>
<p>Some free Positions you can use are: 1,3,6,7,8,9,11,12,13,14,16,17,18,19.</p>
<p>If you want to be more free you must do the following, first we must activate the &#8220;custom_menu_order&#8221; Hook.</p>
<p>Just add this Code in a Plugin, of the functions.php of your template:</p>
<pre class="brush: php">
add_filter(&#039;custom_menu_order&#039;,&#039;custom_menu_order_function&#039;);
function custom_menu_order_function(){
return true;
}
</pre>
<p>Now we can use the menu_order Filter to add our an-uniq-string-as-key at any position we want</p>
<pre class="brush: php">
add_filter(&#039;menu_order&#039;,&#039;menu_order_my_function&#039;);
function menu_order_my_function($menu_order){
$new_menu_order = array();

foreach($menu_order as $position =&gt; $menu_element){
if($position == 4){
$new_menu_order[] = &#039;an-uniq-string-as-key&#039;;
}elseif($menu_element != &#039;an-uniq-string-as-key&#039;){
$new_menu_order[] = $menu_element;
}
}
return $new_menu_order;
}
</pre>
<p>4 is of course the example Position, you can use any you want. To move separators just use the strings &#8220;separator1&#8243;, &#8220;separator2&#8243; and &#8220;separator-last&#8221; unfortunately it seams you can only move the existing Separators, not add new ones.</p>
<p>But like i said, this is not documented, so use it carefully if you choose so. And most important, think if your Plug-in &#8220;add-alt-seo-title-to-dohikkie&#8221; really need the number one Position.</p>
<h4>Access Limitations</h4>
<p>You See in all this functions always an numeric value for the Access Rights, wich value Reflects witch user type you can see at <a href="http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table">the Capability vs. Role Table</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lautr.com/adding-menu-and-option-pages-in-wordpress-different-possibilities/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Display Image count like, picture x of y in WordPress</title>
		<link>http://www.lautr.com/display-image-count-like-picture-x-of-y-in-wordpress/</link>
		<comments>http://www.lautr.com/display-image-count-like-picture-x-of-y-in-wordpress/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 10:38:46 +0000</pubDate>
		<dc:creator>Hannes</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[attachment]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[wp]]></category>
		<category><![CDATA[x of y]]></category>

		<guid isPermaLink="false">http://www.lautr.com/?p=62</guid>
		<description><![CDATA[In a recent Situation i needed to display the attachments of an Wordpress Post, the Images, in a click-through-like manner. I also decided to display the current number in relation to the full number of Images you are currently looking at, like a simple "Picture 5 of 7". Since there is no build in Option for that I had to build my own. <a href="http://www.lautr.com/display-image-count-like-picture-x-of-y-in-wordpress/">Weiterlesen <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>In a recent Situation i needed to display the attachments of an WordPress Post, the Images, in a click-through-like manner. I also decided to display the current number in relation to the full number of Images you are currently looking at, like a simple &#8220;Picture 5 of 7&#8243;. Since there is no build in Option for that I had to build my own.</p>
<pre class="brush: php">
function getNumberOfSiblings($parentid){
$images = (get_children(array(
&#039;post_parent&#039; 	=&gt; $parentid,
&#039;post_type&#039; 	=&gt; &#039;attachment&#039;,
&#039;post_mime_type&#039;=&gt; &#039;image&#039;,
)));
return count($images);
}

function getCurrentNumberOfSibling($parentid,$siblingid){
$images = (get_children(array(
&#039;post_parent&#039; 	=&gt; $parentid,
&#039;post_type&#039; 	=&gt; &#039;attachment&#039;,
&#039;post_mime_type&#039;=&gt; &#039;image&#039;,
)));
if($images[$siblingid]-&gt;menu_order != 0){
return $images[$siblingid]-&gt;menu_order;
}else{
$i = count($images);
foreach($images as $image){
if($image-&gt;ID ==$siblingid){
return $i;
}
$i--;
}
}
}
</pre>
<p>I mainly just use the get_children function, in the first case to count all the returned siblings and in the second case to get the Position of the current Attachment I use the menu_order Attribute of that matter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lautr.com/display-image-count-like-picture-x-of-y-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using apc (User agent is rejected)
Database Caching 4/17 queries in 0.026 seconds using apc
Object Caching 322/358 objects using apc
Content Delivery Network via static.lautr.com

Served from: www.lautr.com @ 2012-02-06 02:23:55 -->
