<?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>elektroelch.net</title>
	<atom:link href="http://elektroelch.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://elektroelch.net</link>
	<description>WordPress and stuff.</description>
	<lastBuildDate>Fri, 11 May 2012 10:29:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<atom:link rel='hub' href='http://elektroelch.net/?pushpress=hub'/>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Yet another rant about bad WordPress plugin programming habits</title>
		<link>http://elektroelch.net/yet-another-rant-about-bad-wordpress-plugin-programming-habits/</link>
		<comments>http://elektroelch.net/yet-another-rant-about-bad-wordpress-plugin-programming-habits/#comments</comments>
		<pubDate>Thu, 10 May 2012 16:21:47 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=551</guid>
		<description><![CDATA[The other day I came across a plugin that provided some useful functions to WordPress but is so badly coded that I can&#8217;t recommend it to anyone to use it. Though there are a lot of blog posts ranting about people &#8220;doing it wrong&#8221; this not be named plugin does so many things wrong in [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I came across a plugin that provided some useful functions to WordPress but is so badly coded that I can&#8217;t recommend it to anyone to use it. Though there are a lot of blog posts ranting about people &#8220;doing it wrong&#8221; this not be named plugin does so many things wrong in one place that I&#8217;m simply feeling the urge to write about a few of them.<br />
<span id="more-551"></span></p>
<h3>Creating tables in the database</h3>
<p>WordPress provides tables and, yet even better, functions to store the data of your plugin. There is for example <code>wp_postmeta</code> to store data applying to a post, repectively <code>wp_usermeta</code> for user data.<br />
To store general data of your plugin you can use the </code>wp_options</code> table. You don't even need to create a new row for every single piece of data but you can combine all your data into an array and use the <code>serialize()</code> function to store it into a single set.<br />
(<b>Edit</b>: Since version 2.0.1 it's not necessary to seialize the data yourself because the update_* take care of it themselves.)<br />
As you see, there is no need to create your own tables or to use your own SQL statements.</p>
<h3>Always requesting "fresh" data</h3>
<p>You do not need to pull data from external sources or aggregate data from the database every time your plugin is executed. There are good chances that the data you need does not change over a longer period of time. You can use some sophisticated WordPress functions to cache the data using the "<a href="https://codex.wordpress.org/Transients_API">Transient API</a>". It provides function to temporary store data (<code><a href="https://codex.wordpress.org/Function_Reference/set_transient">set_transient</a></code>), to retrieve it (<code><a href="https://codex.wordpress.org/Function_Reference/get_transient">get_transient</a></code>) and some others to control storage of temporary data.</p>
<h3>Creating everything from scratch</h3>
<p>WordPress contains a heap of useful functions especially for database access. So before you start connecting manually to the WordPress database take a look at the <code><a href="https://codex.wordpress.org/Class_Reference/wpdb">$wpdb</a></code> class which contains everything you need to coennect to the database, <code><a href="https://codex.wordpress.org/Function_Reference/add_user_meta">add_user_meta</a></code>, <code><a href="https://codex.wordpress.org/Function_Reference/add_post_meta">add_post_meta</a></code>, and other useful functions to store, alter and delete data. Take a look at them before even thinking about creating your custom SQL statement. Besides being easy to use these function assure that your plugin will work even if the database layout is changed dramatically.</p>
<h3>After me, the deluge!</h3>
<p>Your plugin may be the best invention since sliced bread and everyone should use it. Nevertheless be convinced that there are definitely people who test you plugin and think that there must be something better and uninstall it. So take care that your plugin does no leave any clutter in the database by deleting any trace on uninstall. On <b>uninstall</b> not on <b>deactivation</b> because a user may deactivate your plugin though he wants to continue using it, e.g. for debugging purposes, and would be happy if his options are still set upon re-activation. So be nice!</p>
<p>There are many other things you can <em>do wrong &reg;</em> at programming a good WordPress plugin and I hope that <em><a href="http://twitter.com/nacin">@nacin</a></em> will create a blog about it some day.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/yet-another-rant-about-bad-wordpress-plugin-programming-habits/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My favorite Greasemonkey-Script</title>
		<link>http://elektroelch.net/my-favorite-greasemonkey-script/</link>
		<comments>http://elektroelch.net/my-favorite-greasemonkey-script/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 11:00:15 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[blogging]]></category>
		<category><![CDATA[atom]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[rss]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=523</guid>
		<description><![CDATA[Greasemonkey is a fine Firefox-Addon that allows you to execute some Javascript on the page to change the content or do other stuff to enhance the experience. My all-time favorite is Jasper&#8217;s Google Reader subscribe. What does it do? Every blog, almost every news site, and many other web sites provide RSS feeds. They are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://addons.mozilla.org/de/firefox/addon/greasemonkey/" title="Greasemonkey">Greasemonkey </a>is a fine Firefox-Addon that allows you to execute some Javascript on the page to change the content or do other stuff to enhance the experience.<br />
My all-time favorite is <a href="https://userscripts.org/scripts/show/2571">Jasper&#8217;s Google Reader subscribe</a>. What does it do?<br />
Every blog, almost every news site, and many other web sites provide RSS feeds. They are a handy thing but some sites make it hard to find the corresponding link or don&#8217;t display it at all. The only chance to find the link would be to browse the source code of the page. Scanning the code while you&#8217;re in front of a computer? Ridiculous! Let&#8217;s use the machine and that&#8217;s what this script does.<br />
It looks for links containing the strings &#8220;rss&#8221;, &#8220;atom&#8221;, or &#8220;rdf&#8221; and displays a small icon at the top right of your browser:</p>
<p><a href="http://elektroelch.net/files/2012/02/jasper1.png" rel="lightbox[523]"><img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://elektroelch.net/files/2012/02/jasper1.png" alt="" title="jasper1" width="84" height="68" class="aligncenter size-full wp-image-524" /></a></p>
<p>If you hover the mouse cursor over the icon all found feeds will be displayed:</p>
<p><a href="http://elektroelch.net/files/2012/02/jasper2.png" rel="lightbox[523]"><img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://elektroelch.net/files/2012/02/jasper2.png" alt="" title="jasper2" width="264" height="88" class="aligncenter size-full wp-image-527" /></a></p>
<p>As you see not only the main feed is found but also the comment feed and possible others. With this script installed you can simply click on this icon and subscribe to feeds without frantically scanning the page.</p>
<ul>
<li>
<a href="https://userscripts.org/scripts/show/2571">Download &#8220;Jasper’s Google Reader subscribe&#8221;</a>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/my-favorite-greasemonkey-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The selectbox mystery of WordPress</title>
		<link>http://elektroelch.net/the-selectbox-mystery-of-wordpress/</link>
		<comments>http://elektroelch.net/the-selectbox-mystery-of-wordpress/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 14:42:05 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=507</guid>
		<description><![CDATA[The other day I wanted to use a selectbox with 5 elements in my plugin&#8217;s option page. No problem I thought: &#60;select size=&#34;5&#34;&#62; &#60;option &#34;test1&#34; /&#62; &#60;option &#34;test2&#34; /&#62; &#60;option &#34;test3&#34; /&#62; &#60;option &#34;test4&#34; /&#62; &#60;option &#34;test5&#34; /&#62; &#60;option &#34;test6&#34; /&#62; &#60;/select&#62; What everybody including me expects is something like this: But I actually got [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I wanted to use a selectbox with 5 elements in my plugin&#8217;s option page. No problem I thought:</p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;select size=&quot;5&quot;&gt;
  &lt;option &quot;test1&quot; /&gt;
  &lt;option &quot;test2&quot; /&gt;
  &lt;option &quot;test3&quot; /&gt;
  &lt;option &quot;test4&quot; /&gt;
  &lt;option &quot;test5&quot; /&gt;
  &lt;option &quot;test6&quot; /&gt;
&lt;/select&gt;</pre></div></div>

<p>What everybody including me expects is something like this:<br />
<img style=' float: left; padding: 4px; margin: 0 7px 2px 0;'  src="http://elektroelch.net/files/2011/12/select1.png" alt="" title="select1" width="98" height="141" class="alignleft size-full wp-image-508" /><br clear="all"></p>
<p>But I actually got this:<br />
<img style=' float: left; padding: 4px; margin: 0 7px 2px 0;'  src="http://elektroelch.net/files/2011/12/select2.png" alt="" title="select2" width="88" height="60" class="alignleft size-full wp-image-509" /><br clear="all"></p>
<p>The mystery lies in the style sheet for the admin area:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #cc00cc;">#wpcontent</span> select <span style="color: #00AA00;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">2em</span><span style="color: #00AA00;">;</span>
	<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span> <span style="color: #933;">12px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>This forces every selectbox to display only one element. I have no idea why this is implemented. There is also a <a href="http://core.trac.wordpress.org/ticket/10331">ticket</a> in the WP tracking system discussing this behaviour since two years. </p>
<p>The solution to this problem is quite easy:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>select style<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;height:auto&quot;</span> size<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;5&quot;</span><span style="color: #339933;">&gt;</span></pre></div></div>

<p>Seems easy but costed me over 1 hour of my lifetime.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/the-selectbox-mystery-of-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress: Shorten title</title>
		<link>http://elektroelch.net/wordpress-shorten-title/</link>
		<comments>http://elektroelch.net/wordpress-shorten-title/#comments</comments>
		<pubDate>Mon, 22 Aug 2011 15:03:03 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[wordpress tutorial]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=474</guid>
		<description><![CDATA[A frequently asked question in WordPress forum is how to shorten the title of a post to a predefined number of characters and to append a &#8220;&#8230;&#8221;. The problem is solved with a few lines of code: 1 2 3 4 5 6 7 8 9 add_filter&#40; 'the_title', 'short_title' &#41;; function short_title&#40; $title &#41; &#123; [...]]]></description>
			<content:encoded><![CDATA[<p>A frequently asked question in WordPress forum is how to shorten the title of a post to a predefined number of characters and to append a &#8220;&hellip;&#8221;.</p>
<p>The problem is solved with a few lines of code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'the_title'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'short_title'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> short_title<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$chars</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$chars</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$chars</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$title</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; &amp;hellip;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$title</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The variable <code>$chars</code> has to be set to the number of characters you want to have in your title and in line 6 you have to define the text to replace the omitted part of the title (<code>&amp;hellip;</code> is the typographically correct version of three points, called ellipse).</p>
<p>It&#8217;s a bit disadvantageous that the title could be cut in the middle of a word. If you like you can extend the function accordingly:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'the_title'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'short_title'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> short_title<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000088;">$chars</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">20</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$chars</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$chars</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="display:block;background-color: #ffc;">    <span style="color: #000088;">$title</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strrpos</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$title</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' '</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>		</span>    <span style="color: #000088;">$title</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">&quot; &amp;hellip;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$title</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>If you copy the function into the file <code>functions.php</code> of your theme all calls of <code>the_title</code> will return the shortened title.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/wordpress-shorten-title/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Remove &#8220;by author&#8221; post section from Genesis themes</title>
		<link>http://elektroelch.net/remove-by-author-post-section-from-genesis-themes/</link>
		<comments>http://elektroelch.net/remove-by-author-post-section-from-genesis-themes/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 14:06:46 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[genesis]]></category>
		<category><![CDATA[theme]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=454</guid>
		<description><![CDATA[As I already wrote in How-to remove the author from your Twenty-Ten posts most blogs do not need the section &#8220;by author&#8221; since there is only one author. By default most Genesis themes contain this section (e.g. the prose theme): Let&#8217;s see how-to remove the author&#8217;s name from the post info. The post info is [...]]]></description>
			<content:encoded><![CDATA[<p>As I already wrote in <a href="http://elektroelch.net/how-to-remove-the-author-from-your-twenty-ten-posts/">How-to remove the author from your Twenty-Ten posts</a> most blogs do not need the section &#8220;by author&#8221; since there is only one author.<br />
By default most Genesis themes contain this section (e.g. the prose theme):</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://elektroelch.net/files/2011/08/17.08.0.png" alt="" title="17.08.0" width="394" height="94" class="aligncenter size-full wp-image-459" /></p>
<p>Let&#8217;s see how-to remove the author&#8217;s name from the post info. <span id="more-454"></span></p>
<p>The post info is produced by this function:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> genesis_post_info<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$post</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> is_page<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: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #b1b100;">return</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// don't do post-info on pages</span>
&nbsp;
  <span style="color: #000088;">$post_info</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'[post_date] '</span> <span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'By'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'genesis'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> 
               <span style="color: #0000ff;">' [post_author_posts_link] [post_comments] [post_edit]'</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'&lt;div class=&quot;post-info&quot;&gt;%s&lt;/div&gt;'</span><span style="color: #339933;">,</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'genesis_post_info'</span><span style="color: #339933;">,</span>
          <span style="color: #000088;">$post_info</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>As you see the function calls a filter for the string <code>$post_info</code> which contains the shortcodes for the post info. So it&#8217;s easy to define a function which removes the &#8220;<code>__('By', 'genesis') . ' [post_author_posts_link]</code>&#8221; code:</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;">'genesis_post_info'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_post_info'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">function</span> my_post_info<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$post_info</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'[post_date] [post_comments] [post_edit]'</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #000088;">$post_info</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>If you put the code in the <code>functions.php</code> of your Genesis child theme the output looks something like this:</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://elektroelch.net/files/2011/08/17.08.1.png" alt="" title="17.08.1" width="404" height="98" class="aligncenter size-full wp-image-466" /></p>
<p>This is all you need if you&#8217;re your blog&#8217;s only author.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/remove-by-author-post-section-from-genesis-themes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WordPress: Remove links from the_category()</title>
		<link>http://elektroelch.net/wordpress-remove-links-from-the-category/</link>
		<comments>http://elektroelch.net/wordpress-remove-links-from-the-category/#comments</comments>
		<pubDate>Mon, 20 Jun 2011 15:59:10 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wordpress tutoral]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=364</guid>
		<description><![CDATA[The standard way to display the categories a post belongs to is to use the function the_category, e.g, the call the_category(', '); will output: link, photo, regular, video As you see the categories are automatically linked to their respective category pages which in most cases is the style needed. Nevertheless there may be situations where [...]]]></description>
			<content:encoded><![CDATA[<p>The standard way to display the categories a post belongs to is to use the function <code><a href="http://codex.wordpress.org/Function_Reference/the_content">the_category</a></code>, e.g, the call <code>the_category(', ');</code> will output:</p>
<p><a href="#" title="View all posts in link" rel="category tag">link</a>, <a href="#" title="View all posts in photo" rel="category tag">photo</a>, <a href="#" title="View all posts in regular" rel="category tag">regular</a>, <a href="#" title="View all posts in video" rel="category tag">video</a></p>
<p>As you see the categories are automatically linked to their respective category pages which in most cases is the style needed. Nevertheless there may be situations where you (or your customer) does not want the categories to link anywhere. Unfortunately WordPress does not provide any straightforward method to accomplish this so we have to make a small detour.</p>
<p>There are two ways we can take: rebuild the output or filter the output.<span id="more-364"></span></p>
<h3>Rebuilding the output</h3>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$sep</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">', '</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$cats</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span> get_the_category<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$category</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$i</span><span style="color: #009900;">&#41;</span>
    <span style="color: #000088;">$cats</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$sep</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$cats</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$category</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cat_name</span><span style="color: #339933;">;</span>
  <span style="color: #000088;">$i</span><span style="color: #339933;">++;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$cats</span><span style="color: #339933;">;</span></pre></div></div>

<p>(I found the basics for this solution at <a href="http://www.sydneyfx.com.au/wordpress/how-to-remove-link-from-the_category-in-wordpress/167">SydneyFX</a>.)<br />
The code does what we want  but it has the disadvantage that it leaves out all the candy provided by the original function. So there has to be a better solution.</p>
<h3>Filter the standard output</h3>
<p>WordPress is full of filters and as expected there is also a filter for the output of <code>the_category()</code>. So let&#8217;s us it:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> no_links<span style="color: #009900;">&#40;</span><span style="color: #000088;">$thelist</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'#&lt;a.*?&gt;([^&lt;]*)&lt;/a&gt;#i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'$1'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$thelist</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'the_category'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'no_links'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#91;</span><span style="color: #339933;">...</span><span style="color: #009900;">&#93;</span> The Loop <span style="color: #009900;">&#91;</span><span style="color: #339933;">..</span><span style="color: #009900;">&#93;</span>
&nbsp;
remove_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'the_category'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'no_links'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The function <code>no_links()</code> contains a regular expression which removes all anchors from the string. That&#8217;s the whole trick. At the end of your code you should remove the filter again, just in case the categories are displayed on the same page with the standard style.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/wordpress-remove-links-from-the-category/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress plugins: Don&#8217;t hard code path names &#8230;almost never!</title>
		<link>http://elektroelch.net/dont-hard-code-path-names/</link>
		<comments>http://elektroelch.net/dont-hard-code-path-names/#comments</comments>
		<pubDate>Sat, 11 Jun 2011 16:22:08 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=350</guid>
		<description><![CDATA[The other day I found a plugin claiming the following in its instructions: 1) Upload the entire my-cool-plugin folder to the /wp-content/plugins/ directory 2) DO NOT change the name of the my-cool-plugin folder [...] What the heck? Why shouldn&#8217;t I change the name of the folder? The author didn&#8217;t actually hard code the plugin path [...]]]></description>
			<content:encoded><![CDATA[<p>The other day I found a plugin claiming the following in its instructions:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">1) Upload the entire my-cool-plugin folder to the /wp-content/plugins/ directory
2) DO NOT change the name of the my-cool-plugin folder
[...]</pre></div></div>

<p>What the heck? Why shouldn&#8217;t I change the name of the folder? The author didn&#8217;t actually hard code the plugin path of the plugin, did he?<span id="more-350"></span></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">load_plugin_textdomain<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my-cool-plugin'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my-cool-plugin/languages'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Yes he did! And now he&#8217;s hoping that all users won&#8217;t change the path name. But they will, Murphy&#8217;s everywhere! And after they did so they will write you an email complaining that the plugin does not work, never telling you that they changed the pathname, of course.</p>
<p>To avoid such trouble isn&#8217;t too difficult because you can determine the name of your plugin using some simple functions:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$plugin_path</span> <span style="color: #339933;">=</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span>plugin_basename<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
load_plugin_textdomain<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'my-cool-plugin'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">,</span> <span style="color: #000088;">$plugin_path</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/languages'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Each part of the code will return the following:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">__FILE__ -&gt; /path-to-wordpress/wp-content/plugins/my-cool-plugin/plugin.php
&nbsp;
plugin_basename(__FILE__) -&gt; my-cool-plugin/plugin
&nbsp;
dirname(plugin_basename(__FILE__)) -&gt; my-cool-plugin</pre></div></div>

<p>Now the user can name the plugin directory whatever he likes, your plugin is prepared.<br />
So if you ever want to point to a directory first make sure that there is no way to determine it by the use of some function before putting it literally in your code.</p>
<p>In the heading I wrote &#8220;&#8230; almost never&#8221; because you can and actually have to refer to directories <strong>below</strong> your plugin directory directly in your code. </p>
<p>BTW: I downloaded the above mentioned plugin from a well known theme creator&#8217;s site.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/dont-hard-code-path-names/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>WordPress: Unified Login Error Messages - Add more security to your blog by changing the error messages</title>
		<link>http://elektroelch.net/wordpress-unified-login-error-messages/</link>
		<comments>http://elektroelch.net/wordpress-unified-login-error-messages/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 13:44:23 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=266</guid>
		<description><![CDATA[If you log-in to your WordPress blog and use an unregistered username the system will answer &#8220;ERROR: Invalid username. Lost your password?&#8221; and if you got your username right but not your password: &#8220;ERROR: The password you entered for the username admin is incorrect. Lost your password?&#8221; So you know independently if you used a [...]]]></description>
			<content:encoded><![CDATA[<p>If you log-in to your WordPress blog and use an unregistered username the system will answer &#8220;ERROR: Invalid username. Lost your password?&#8221; and if you got your username right but not your password: &#8220;ERROR: The password you entered for the username admin is incorrect. Lost your password?&#8221;<br />
So you know independently if you used a registered username or if the password isn&#8217;t right. That&#8217;s nice of WordPress, isn&#8217;t it? From the user point of view sure it is &#8230; and from the view of a possible attacker, too!<span id="more-266"></span></p>
<p>There are many tutorials telling that you should rename your admin account to something else so that an attacker does not already has got a clue what account he has to break. Unfortunately WordPress is telling everyone if you have done so or not:</p>
<p><img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://elektroelch.net/files/2011/06/06.06.png" alt="" title="06.06" width="372" height="447" class="aligncenter size-full wp-image-271" /><br />
This blog owner was not so cautious and hasn&#8217;t changed the admin account. Now the attacker has a first clue and only needs to test his passwords against this username.<br />
Wouldn&#8217;t it be much better if the error message would be the same no matter if the username is right or not:<br />
<img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://elektroelch.net/files/2011/06/07.06.png" alt="" title="07.06" width="387" height="435" class="aligncenter size-full wp-image-293" /><br />
Now the attacker does not know if the username is registered and has to try all his passwords even if the name is wrong.<br />
The above error message is created by my new plugin called &#8220;Unified Login Error Messages&#8221; (or &#8220;Ulem&#8221;). It changes the two above mentioned error messages but keeps others like &#8220;The username field is empty.&#8221; untouched.<br />
There are some <a href="http://www.wprecipes.com/wordpress-security-hide-login-error-messages">tutorials</a> telling you how to disable the error messages totally but no response to a user&#8217;s action is one of the main failures in UI design. </p>
<p><a href="http://wordpress.org/extend/plugins/unified-login-error-messages/">Download the plugin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/wordpress-unified-login-error-messages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How-to remove the author from your Twenty-Ten posts</title>
		<link>http://elektroelch.net/how-to-remove-the-author-from-your-twenty-ten-posts/</link>
		<comments>http://elektroelch.net/how-to-remove-the-author-from-your-twenty-ten-posts/#comments</comments>
		<pubDate>Mon, 30 May 2011 15:05:42 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=250</guid>
		<description><![CDATA[There are more than 1300 themes available in the official Theme Directory but many WordPress blogs are using the default theme Twenty Ten. The default header of a post looks like this: Besides the date of publications the author of the article is displayed but since most blogs are operated by single persons this information [...]]]></description>
			<content:encoded><![CDATA[<p>There are more than 1300 themes available in the official <a href="https://wordpress.org/extend/themes/">Theme Directory</a> but many WordPress blogs are using the default theme <em>Twenty Ten</em>. The default header of a post looks like this:<br />
<a href="http://elektroelch.net/files/2011/05/30.051.png" rel="lightbox[250]"><img style=' display: block; margin-right: auto; margin-left: auto;'  src="http://elektroelch.net/files/2011/05/30.051.png" alt="" title="30.05" width="400" height="74" class="aligncenter size-full wp-image-261" /></a><br />
Besides the date of publications the author of the article is displayed but since most blogs are operated by single persons this information is totally unnecessary. Additionally many bloggers write their posting while they&#8217;re logged in as Administrator so that the author is displayed has &#8220;admin&#8221;. This is not only unnecessary but also looks like you can&#8217;t handle your blog correctly.<br />
<span id="more-250"></span><br />
So if you&#8217;re tired of displaying the author in the head of your post you can follow this small how-to.</p>
<p>If you&#8217;re doing any changes to the Twenty Eleven theme you should never ever modify the files in the <code>twentyten</code> directory. Instead create a child theme:</p>
<ul>
<li>Create a directory called <code>myTwentyTen</code>
<li>Create a file <code>style.css</code> containing:

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/*
	Theme Name: my2010
	Theme URL: 
	Description:2010 test child theme
	Author: Latz
	Author URI: http://elektroelch.de
	Version: 1.0
	Template: twentyten
&nbsp;
*/</span>
&nbsp;
<span style="color: #a1a100;">@import url(&quot;../twentyten/style.css&quot;);</span></pre></div></div>

<p>(Change <code>Author:</code> and <code>Author URI</code> to your needs.)
</li>
</ul>
<p>Create a file called <code>functions.php</code>. In this file we&#8217;re going to save the modified code for displaying the author&#8217;s name:</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>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> twentyten_posted_on<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">printf</span><span style="color: #009900;">&#40;</span> __<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'&lt;span class=&quot;%1$s&quot;&gt;Posted on&lt;/span&gt; %2$s &lt;span class=&quot;meta-sep&quot;&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'twentyten'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <span style="color: #0000ff;">'meta-prep meta-prep-author'</span><span style="color: #339933;">,</span>
    <span style="color: #990000;">sprintf</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'&lt;a href=&quot;%1$s&quot; title=&quot;%2$s&quot; rel=&quot;bookmark&quot;&gt;&lt;span class=&quot;entry-date&quot;&gt;%3$s&lt;/span&gt;&lt;/a&gt;'</span><span style="color: #339933;">,</span>
      get_permalink<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      esc_attr<span style="color: #009900;">&#40;</span> get_the_time<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
      get_the_date<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</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: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>This is the original code from <em>Twenty Ten</em>&#8216;s <code>function.php</code> with all code removed which concerns the author. <em>Twenty Ten</em> has the advantage that is uses this code in all places where it displays &#8220;by author&#8221;. So there is no need to change anything else.</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/how-to-remove-the-author-from-your-twenty-ten-posts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HTML/PHP: Single and double quotes - Code can be more readable if you know the specs</title>
		<link>http://elektroelch.net/htmlphp-single-and-double-quotes/</link>
		<comments>http://elektroelch.net/htmlphp-single-and-double-quotes/#comments</comments>
		<pubDate>Mon, 30 May 2011 13:02:55 +0000</pubDate>
		<dc:creator>latz</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://elektroelch.de/net/?p=225</guid>
		<description><![CDATA[If PHP programmers are creating a link from variables often you can see the following code: echo '&#60;a href=&#34;' . $link . '&#34; id=&#34;' . $id .'&#34; class=&#34;' . $class . '&#34;&#62;' . $linktext . '&#60;/a&#62;'; or ?&#62; &#60;a href=&#34;&#60;?php echo $link; ?&#62;&#34; id=&#34;&#60;?php echo $id; ?&#62;&#34; class=&#34;&#60;?php echo $class; ?&#62;&#34;&#62;&#60;?php echo $linktext; ?&#62;&#60;/a&#62; &#60;?php [...]]]></description>
			<content:encoded><![CDATA[<p>If PHP programmers are creating a link from variables often you can see the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;a href=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$link</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; id=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$id</span> <span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; class=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> 
       <span style="color: #000088;">$linktext</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/a&gt;'</span><span style="color: #339933;">;</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">?&gt;
&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$link</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; id=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$id</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; 
   class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$class</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$linktext</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span></pre></div></div>

<p>or</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$link</span><span style="color: #000099; font-weight: bold;">\&quot;</span> id=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$id</span><span style="color: #000099; font-weight: bold;">\&quot;</span> class=<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$class</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&gt;<span style="color: #006699; font-weight: bold;">$linktext</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Apart from the personal preferences of the programmer all these snippets have one thing in common: they are hard to read. &#8220;Sure!&#8221;, you will say, &#8220;attributes in HTML have to be enclosed in double quotes and in PHP I have to use one of the above methods.&#8221; Are you sure? Do attributes <em>really</em> have to be enclosed in <em>double quotes</em>? The simple answer is: No!<br />
Let&#8217;s take a look at the <a href="http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.2">specification</a>:<br />
<quote><br />
[...] By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks (ASCII decimal 39). Single quote marks can be included within the attribute value when the value is delimited by double quote marks, and vice versa. [...]<br />
</quote><br />
Double <strong>or</strong> single quotation marks. That will make things much easier:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;a href='<span style="color: #006699; font-weight: bold;">$link</span>' id='<span style="color: #006699; font-weight: bold;">$id</span>' class='<span style="color: #006699; font-weight: bold;">$class</span>'&gt;<span style="color: #006699; font-weight: bold;">$linktext</span>&lt;/a&gt;&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>As you see the code is much easier to read and that simply happened because you read the specs!</p>
]]></content:encoded>
			<wfw:commentRss>http://elektroelch.net/htmlphp-single-and-double-quotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

