<?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>soderlind.no</title>
	<atom:link href="http://soderlind.no/feed/" rel="self" type="application/rss+xml" />
	<link>http://soderlind.no</link>
	<description>I code for fun</description>
	<lastBuildDate>Thu, 10 May 2012 08:57:37 +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>An alternative &#8220;Hide ACF Menu from Clients&#8221;</title>
		<link>http://soderlind.no/archives/2012/03/30/an-alternative-hide-acf-menu-from-clients/</link>
		<comments>http://soderlind.no/archives/2012/03/30/an-alternative-hide-acf-menu-from-clients/#comments</comments>
		<pubDate>Thu, 29 Mar 2012 22:47:31 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[acf]]></category>
		<category><![CDATA[advanced custom fields]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=3268</guid>
		<description><![CDATA[Here&#8217;s an alternative to Hide ACF Menu from Clients, add it to your functions.php: Note, remove_menu_page() needs WordPress 3.1 or newer]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an alternative to <a href="http://www.advancedcustomfields.com/docs/tutorials/hide-acf-menu-from-clients/">Hide ACF Menu from Clients</a>, add it to your functions.php:</p>
<pre class="brush: php; title: ; notranslate">
add_action( 'admin_menu', function() {
	if (! current_user_can('administrator')) {
		remove_menu_page('edit.php?post_type=acf');
	}
});
</pre>
<p>Note, <a href="http://codex.wordpress.org/Function_Reference/remove_menu_page">remove_menu_page()</a> needs WordPress 3.1 or newer</p>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2012/03/30/an-alternative-hide-acf-menu-from-clients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Date and Time Picker field for Advanced Custom Fields</title>
		<link>http://soderlind.no/archives/2012/03/09/time-picker-field-for-advanced-custom-fields/</link>
		<comments>http://soderlind.no/archives/2012/03/09/time-picker-field-for-advanced-custom-fields/#comments</comments>
		<pubDate>Fri, 09 Mar 2012 17:19:31 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[wp-plugins]]></category>
		<category><![CDATA[acf]]></category>
		<category><![CDATA[custom fields]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=3213</guid>
		<description><![CDATA[This is an add-on for the Advanced Custom Fields WordPress plugin, that allows you to add a Date and Time Picker field type. Changlog: 1.2.0 Updated jquery-ui-timepicker-addon.js to the latest version (1.0.0) and added localization support. 1.1.1 Fixed a small &#8230; <a href="http://soderlind.no/archives/2012/03/09/time-picker-field-for-advanced-custom-fields/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://soderlind.no/wp-content/uploads/2012/03/acf_time_picker-1.1.011.png"><img class="aligncenter size-medium wp-image-3248" title="Date and Time Picker" src="http://soderlind.no/wp-content/uploads/2012/03/acf_time_picker-1.1.011-300x160.png" alt="" width="300" height="160" /></a></p>
<p>This is an add-on for the <a href="http://www.advancedcustomfields.com/">Advanced Custom Fields</a> WordPress plugin, that allows you to add a Date and Time Picker field type.</p>
<p><span id="more-3213"></span></p>
<h3>Changlog:</h3>
<ul>
<li>1.2.0 Updated jquery-ui-timepicker-addon.js to the latest version (1.0.0) and added <a href="#localization">localization</a> support.</li>
<li>1.1.1 Fixed a small bug</li>
<li>1.1 Change name to Date and Time Picker to reflect the new option to select between Date and Time picker or Time Picker only. Thanks to Wilfrid for point this out (not sure why I didn&#8217;t include it in 1.0)</li>
<li>1.0: Initial version</li>
</ul>
<p><strong>Latest version</strong>: <a href="http://soderlind.no/download/acf_time_picker.zip">http://soderlind.no/download/acf_time_picker.zip</a></p>
<p><strong>Prerequisite:</strong> <a href="http://wordpress.org/extend/plugins/advanced-custom-fields/">Advanced Custom Fields WordPress plugin</a> installed and activated.</p>
<h3>Installation:</h3>
<ol>
<li>Extract <a href="http://soderlind.no/download/acf_time_picker.zip">http://soderlind.no/download/acf_time_picker.zip</a> in your theme folder (WordPress child theme is supported).<br />
After you have extracted the file, you should have the following subdirectories in your theme folder:</p>
<pre>acf_time_picker
	 |____ css
	 | |____ images
	 |____ js
         |____ lang</pre>
</li>
<li>Add the following to your themes functions.php (functions.php in a WordPress child theme is supported):
<pre class="brush: php; title: ; notranslate">
&lt;?php
   if(function_exists('register_field')) {
	 register_field('acf_time_picker', dirname(__File__) . '/acf_time_picker/acf_time_picker.php');
   }
?&gt;
</pre>
</li>
</ol>
<h3>Create a Time Picker field:</h3>
<ul>
<li>Time Picker:<br />
<a href="http://soderlind.no/wp-content/uploads/2012/03/acf_time_picker-1.1.021.png"><img class="alignnone size-medium wp-image-3250" title="Time Picker" src="http://soderlind.no/wp-content/uploads/2012/03/acf_time_picker-1.1.021-300x100.png" alt="" width="300" height="100" /></a></li>
<li>Add the Date and Time Picker:<br />
<a href="http://soderlind.no/wp-content/uploads/2012/03/acf_time_picker-1.1.03.png"><img class="alignnone size-medium wp-image-3244" title="Select Date and Time Picker" src="http://soderlind.no/wp-content/uploads/2012/03/acf_time_picker-1.1.03-300x180.png" alt="" width="300" height="180" /></a></li>
<li>Set the date and time format:<br />
<a href="http://soderlind.no/wp-content/uploads/2012/03/acf_time_picker-1.1.04.png"><img class="alignnone size-medium wp-image-3245" title="Set date and time format" src="http://soderlind.no/wp-content/uploads/2012/03/acf_time_picker-1.1.04-300x238.png" alt="" width="300" height="238" /></a></li>
</ul>
<h3>Retrieving Time Picker values</h3>
<ul>
<li>To get a general understanding on how to retrieve values from ACF, see the <a href="http://www.advancedcustomfields.com/docs/code-examples/">examples</a> in the <a href="http://www.advancedcustomfields.com/docs/getting-started/">ACF Documentation</a>.</li>
<li>Here&#8217;s how I retrieve that values from the example in the screen shot (note, the example is using the <a href="http://www.advancedcustomfields.com/add-ons/repeater-field/">repeater field</a>):<br />
<a href="http://soderlind.no/wp-content/uploads/2012/03/field_name.png"><img class="alignnone size-medium wp-image-3273" title="Retrieving Time Picker values using the Field Names" src="http://soderlind.no/wp-content/uploads/2012/03/field_name-300x199.png" alt="" width="300" height="199" /></a></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
$rows = get_field('tasks'); // 'tasks' is the repeater field name
if($rows)
{
	echo '&lt;ul&gt;';

	foreach($rows as $row)
	{
		echo '&lt;li&gt;task = ' . $row['task'] . ', start = ' . $row['start'] .', start = ' . $row['end'] .'&lt;/li&gt;';
	}

	echo '&lt;/ul&gt;';
}
?&gt;
</pre>
</li>
</ul>
<p><a name="localization"></a></p>
<h3>Localization:</h3>
<p>Part of the localization is done automatically based on <a href="http://codex.wordpress.org/Installing_WordPress_in_Your_Language">WPLANG</a> in wp-config.php, but you have to translate rest of the text:</p>
<ol>
<li>In acf_time_picker/lang, copy acf_time_picker.po to acf_time_picker-<a href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_16.html#Country-Codes">countrycode</a>_<a href="http://www.gnu.org/software/gettext/manual/html_chapter/gettext_15.html#Language-Codes">LANGUAGECODE</a>.po e.g: acf_time_picker-no_NB.po</li>
<li>Edit the file using <a href="http://www.poedit.net/">poedit</a> or its like, and save the .mo file in acf_time_picker/lang</li>
</ol>
<p><strong>How the translation is done:</strong></p>
<p>I found a really nice routine at <a href="http://www.renegadetechconsulting.com/tutorials/jquery-datepicker-and-wordpress-i18n">Renegade Tech Consulting</a> (currently unavailable, but a copy is available in <a href="http://webcache.googleusercontent.com/search?q=cache:LG5-wdUYzZUJ:www.renegadetechconsulting.com/tutorials/jquery-datepicker-and-wordpress-i18n&amp;hl=en&amp;prmd=imvns&amp;strip=0">google cache</a>) that I use to grab some of the localized text from WordPress:</p>
<pre class="brush: php; title: ; notranslate">
$timepickerArgs = array(
    'closeText'             =&gt; __('Done',$this-&gt;localizationDomain),
    'currentText'           =&gt; __('Today',$this-&gt;localizationDomain),
    'prevText'              =&gt; __('Prev',$this-&gt;localizationDomain),
    'nextText'              =&gt; __('Next',$this-&gt;localizationDomain),
    'monthNames'            =&gt; $this-&gt;strip_array_indices( $wp_locale-&gt;month ),
    'monthNamesShort'       =&gt; $this-&gt;strip_array_indices( $wp_locale-&gt;month_abbrev ),
    'monthStatus'           =&gt; __( 'Show a different month', $this-&gt;localizationDomain ),
    'showMonthAfterYear'    =&gt; false,
    'dayNames'              =&gt; $this-&gt;strip_array_indices( $wp_locale-&gt;weekday ),
    'dayNamesShort'         =&gt; $this-&gt;strip_array_indices( $wp_locale-&gt;weekday_abbrev ),
    'dayNamesMin'           =&gt; $this-&gt;strip_array_indices( $wp_locale-&gt;weekday_initial ),
    'showWeek'              =&gt; false,
    'weekHeader'            =&gt; __('Wk',$this-&gt;localizationDomain),
    'firstDay'              =&gt; get_option( 'start_of_week' ),
    'isRTL'                 =&gt; $wp_locale-&gt;is_rtl(),
    'timeText'              =&gt; __('Time',$this-&gt;localizationDomain),
    'hourText'              =&gt; __('Hour',$this-&gt;localizationDomain),
    'minuteText'            =&gt; __('Minute',$this-&gt;localizationDomain),
    'secondText'            =&gt; __('Second',$this-&gt;localizationDomain),
    'millisecText'          =&gt; __('Millisecond',$this-&gt;localizationDomain),
    'timezoneText'          =&gt; __('Time Zone',$this-&gt;localizationDomain),
);

// Pass the array to the enqueued JS
wp_localize_script( 'timepicker', 'timepicker_objectL10n', $timepickerArgs );

function strip_array_indices( $ArrayToStrip ) {
    foreach( $ArrayToStrip as $objArrayItem) {
        $NewArray[] =  $objArrayItem;
    }
    return( $NewArray );
}
</pre>
<h3>Credit:</h3>
<pre>Time Picker field for Advanced Custom Fields  uses the <a href="http://trentrichardson.com/examples/timepicker/">jQuery timepicker addon</a>
By: Trent Richardson [http://trentrichardson.com]
Version 1.0.0
Last Modified: 02/05/2012

Copyright 2012 Trent Richardson
Dual licensed under the MIT and GPL licenses.

http://trentrichardson.com/Impromptu/GPL-LICENSE.txt

http://trentrichardson.com/Impromptu/MIT-LICENSE.txt</pre>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2012/03/09/time-picker-field-for-advanced-custom-fields/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>Adding WP-PageNavi to the Yoko theme</title>
		<link>http://soderlind.no/archives/2012/01/31/adding-wp-pagenavi-to-the-yoko-theme/</link>
		<comments>http://soderlind.no/archives/2012/01/31/adding-wp-pagenavi-to-the-yoko-theme/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 15:13:51 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[navigation]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=3167</guid>
		<description><![CDATA[I&#8217;m using the Yoko theme and WP-PageNavi here at soderlind.no Yoko is a modern three-column blog theme. A responsive layout optimizes the theme for mobile devices like tablet pcs and modern smartphones (the layout switches to a two- or one-column &#8230; <a href="http://soderlind.no/archives/2012/01/31/adding-wp-pagenavi-to-the-yoko-theme/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m using the <a href="http://wordpress.org/extend/themes/yoko">Yoko theme</a> and <a href="http://wordpress.org/extend/plugins/wp-pagenavi/">WP-PageNavi</a> here at soderlind.no</p>
<p><a href="http://soderlind.no/wp-content/uploads/2012/01/wp-pagenavi-wide.png"><img class="aligncenter size-medium wp-image-3174" style="border: solid 1px #000000;" title="Positioning WP-PageNavi on a wide screen" src="http://soderlind.no/wp-content/uploads/2012/01/wp-pagenavi-wide-293x300.png" alt="" width="293" height="300" /></a><br />
<a href="http://soderlind.no/wp-content/uploads/2012/01/wp-pagenavi-narrow.png"><img class="aligncenter size-medium wp-image-3173" style="display: none;" title="Positioning WP-PageNavi on a screen 680px wide or less" src="http://soderlind.no/wp-content/uploads/2012/01/wp-pagenavi-narrow-230x300.png" alt="" width="230" height="300" /></a></p>
<blockquote><p><a href="http://www.elmastudio.de/wordpress-themes/yoko/">Yoko</a> is a modern three-column blog theme. A responsive layout optimizes the theme for mobile devices like tablet pcs and modern smartphones (the layout switches to a two- or one-column layout depending on the screen size the theme is viewed on).</p></blockquote>
<p><span id="more-3167"></span></p>
<p><strong>Here&#8217;s how I added WP-PageNavi:</strong></p>
<ol>
<li>Downloaded WP-PageNavi from the <a href="http://wordpress.org/extend/plugins/wp-pagenavi/">WordPress plugin directory</a></li>
<li>From the Yoko theme folder, copied author.php, category.php, index.php, search.php and tag.php to my <a href="http://www.elmastudio.de/wp-content/uploads/themes/yokochildthemefolder.zip">Yoko child theme</a> folder and <a href="http://wordpress.org/extend/plugins/wp-pagenavi/installation/">added wp_pagenavi();</a> to each file. I replaced
<pre class="brush: php; title: ; notranslate">
&lt;nav id=&quot;nav-below&quot;&gt;
	&lt;div class=&quot;nav-previous&quot;&gt;&lt;?php next_posts_link( __( '&lt;span class=&quot;meta-nav&quot;&gt;&amp;larr;&lt;/span&gt; Older posts', 'yoko' ) ); ?&gt;&lt;/div&gt;
	&lt;div class=&quot;nav-next&quot;&gt;&lt;?php previous_posts_link( __( 'Newer posts &lt;span class=&quot;meta-nav&quot;&gt;&amp;rarr;&lt;/span&gt;', 'yoko' ) ); ?&gt;&lt;/div&gt;
&lt;/nav&gt;
</pre>
<p>with</p>
<pre class="brush: php; title: ; notranslate">
&lt;nav id=&quot;nav-below&quot;&gt;
	&lt;div id=&quot;pagenavi&quot;&gt;&lt;?php if(function_exists('wp_pagenavi')) { wp_pagenavi(); } ?&gt;&lt;/div&gt;
&lt;/nav&gt;
</pre>
</li>
<li>Configured WP-PageNavi (in Settings -&gt; PageNavi)
<pre>Page Navigation Text

Text For Number Of Pages:    &lt;blank&gt;
Text For Current Page:       <strong>%PAGE_NUMBER%</strong>
Text For Page:               <strong>%PAGE_NUMBER%</strong>
Text For First Page:         <strong>1</strong>
Text For Last Page:          <strong>%TOTAL_PAGES%</strong>
Text For Previous Page:	     <strong>«</strong>
Text For Next Page:	     <strong>»</strong>
Text For Previous:           <strong>...</strong>
Text For Next:               <strong>...</strong>	

Page Navigation Options

Use pagenavi-css.css:        <strong>unchecked</strong>
Page Navigation Style:       <strong>Normal</strong>
Always Show Page Navigation: <strong>checked</strong>
Number Of Pages To Show:     <strong>5</strong>
Number Of Larger Page
Numbers To Show:             <strong>0</strong>
Show Larger Page Numbers
In Multiples Of:             <strong>10</strong></pre>
</li>
<li>Added the following to the style.css in my <a href="http://www.elmastudio.de/wp-content/uploads/themes/yokochildthemefolder.zip">Yoko child theme</a> folder:
<pre class="brush: css; title: ; notranslate">
.wp-pagenavi {
	clear: both;
	text-align:center;
	height:30px;
	padding-left: 22.507%;
}

@media screen and (max-width : 620px) {
	.wp-pagenavi {
		padding-left: 0;
	}
}

.wp-pagenavi a, .wp-pagenavi span, #pagenavi .page {
    border: 1px solid #BFBFBF;
    margin: 2px;
    padding: 3px 5px;
    text-decoration: none;
}
.wp-pagenavi a:hover, .wp-pagenavi span.current {
    border-color: #000000;
}
.wp-pagenavi span.current {
    font-weight: bold;
}
</pre>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2012/01/31/adding-wp-pagenavi-to-the-yoko-theme/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress plugin: Remove &#8220;Comments are closed&#8221;</title>
		<link>http://soderlind.no/archives/2012/01/11/wordpress-plugin-remove-comments-are-closed/</link>
		<comments>http://soderlind.no/archives/2012/01/11/wordpress-plugin-remove-comments-are-closed/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 03:55:59 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[wp-plugins]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[l10n]]></category>
		<category><![CDATA[wordpress plugin]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=3098</guid>
		<description><![CDATA[On posts where comments are closed, the plugin will remove the text &#8216;Comments are closed.&#8217; The plugin supports any languages/text domains, and will remove the text from themes and plugins. Prerequisite: Since the plugin is filtering gettext, your theme/plugin must &#8230; <a href="http://soderlind.no/archives/2012/01/11/wordpress-plugin-remove-comments-are-closed/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://soderlind.no/wp-content/uploads/2012/01/banner-772x250-e1326317189640-300x153.png" alt="" title="banner-772x250" width="300" height="153" class="aligncenter size-medium wp-image-3119" /></p>
<p>On posts where comments are closed, the plugin will remove the text &#8216;Comments are closed.&#8217; The plugin supports any languages/text domains, and will remove the text from themes and plugins. </p>
<p>Prerequisite: Since the plugin is <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext">filtering gettext</a>, your theme/plugin must be <a href="http://wp.smashingmagazine.com/2011/12/29/internationalizing-localizing-wordpress-theme/">localized</a>.</p>
<p>The plugin is available in the <a href="http://wordpress.org/extend/plugins/remove-comments-are-closed/">WordPress plugin directory</a></p>
<p><span id="more-3098"></span><br />
<strong>Plugin source code:</strong></p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
/*
Plugin Name: Remove &quot;Comments are closed&quot;
Plugin URI: http://soderlind.no/archives/2012/01/11/wordpress-plugin-remove-comments-are-closed/
Description: On posts where comments are closed, the plugin will remove the text 'Comments are closed.' The plugin supports any languages/text domains, and will remove the text from themes and plugins.
Author: Per Soderlind
Version: 1.2
Author URI: http://soderlind.no/
*/

add_filter('gettext', 'ps_remove_comments_are_closed', 20, 3);

function ps_remove_comments_are_closed($translated_text, $untranslated_text, $domain) {
    if ( $untranslated_text == 'Comments are closed.' ) {
        return '';
    }
    return $translated_text;
}
?&gt;
</pre>
<p><strong>Changelog:</strong></p>
<ul>
<li>1.2 removed unnecessary code</li>
<li>1.1 initial public release</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2012/01/11/wordpress-plugin-remove-comments-are-closed/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Adding custom headers to the WordPress plugin directory</title>
		<link>http://soderlind.no/archives/2012/01/10/adding-custom-headers-to-the-wordpress-plugin-directory/</link>
		<comments>http://soderlind.no/archives/2012/01/10/adding-custom-headers-to-the-wordpress-plugin-directory/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 20:34:57 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[wp-plugins]]></category>
		<category><![CDATA[custom header]]></category>
		<category><![CDATA[plugin directory]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=3090</guid>
		<description><![CDATA[As an experiment, Matt has turned on custom headers for the plugin directory. How to add a custom header: Make a 772×250 pixel jpeg or png In the plugin root directory, create a new directory &#8220;assets&#8221;: After you&#8217;ve created the &#8230; <a href="http://soderlind.no/archives/2012/01/10/adding-custom-headers-to-the-wordpress-plugin-directory/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://soderlind.no/wp-content/uploads/2012/01/custom-plugin-header.png"><img src="http://soderlind.no/wp-content/uploads/2012/01/custom-plugin-header-300x205.png" alt="" title="Custom plugin header" width="300" height="205" class="aligncenter size-medium wp-image-3125" /></a><br />
As an experiment, Matt has turned on <a href="http://wpdevel.wordpress.com/2011/12/21/been-giving-a-lot-of-thought-to-how/">custom headers for the plugin directory</a>.</p>
<p><span id="more-3090"></span><br />
<strong>How to add a custom header:</strong></p>
<ol>
<li>Make a 772×250 pixel jpeg or png</li>
<li>In the plugin root directory, create a new directory &#8220;assets&#8221;:
<pre class="brush: bash; light: true; title: ; notranslate">mkdir assets</pre>
<p>After you&#8217;ve created the assets directory, you should have the following directories in the plugin root:</p>
<pre class="brush: bash; highlight: [3]; title: ; notranslate">
$ ls -l
total 0
drwxr-xr-x  4 per  _www  136 Jan 11 22:19 assets
drwxr-xr-x  3 per  _www  102 Jan 11 19:57 branches
drwxr-xr-x  3 per  _www  102 Jan 11 19:57 tags
drwxr-xr-x  5 per  _www  170 Jan 11 19:59 trunk
</pre>
</li>
<li>Copy the 772×250 pixel jpeg or png to the assets directory:
<pre class="brush: bash; light: true; title: ; notranslate">cp my-custom-plugin-header.png assets/banner-772x250.png</pre>
</li>
<li>Add the assets directory to svn:
<pre class="brush: bash; light: true; title: ; notranslate">svn add assets</pre>
</li>
<li>Check it in:
<pre class="brush: bash; light: true; title: ; notranslate">svn ci -m 'Adding custom header'</pre>
</li>
</ol>
<p>I&#8217;ve added a custom header to four of my plugins, please have a look: <a href="http://wordpress.org/extend/plugins/lorem-shortcode/">lorem shortcode</a>, <a href="http://wordpress.org/extend/plugins/webputty/">WebPutty Helper</a>, <a href="http://wordpress.org/extend/plugins/wp-denyhost/">WP-DenyHost</a> and <a href="http://wordpress.org/extend/plugins/remove-comments-are-closed/">Remove &#8220;Comments are closed&#8221;</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2012/01/10/adding-custom-headers-to-the-wordpress-plugin-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress and WebPutty</title>
		<link>http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/</link>
		<comments>http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 22:24:53 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[wp-plugins]]></category>
		<category><![CDATA[Cascading Style Sheets]]></category>
		<category><![CDATA[CDN]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[syntax-highlighting CSS editor]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=3035</guid>
		<description><![CDATA[I&#8217;ve written a simple plugin that allows you to modify your WordPress sites using WebPutty. So what&#8217;s WebPutty? WebPutty is a simple CSS editing and hosting service. WebPutty gives you a syntax-highlighting CSS editor you can use from anywhere, the &#8230; <a href="http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://soderlind.no/wp-content/uploads/2011/12/webputty07.png"><img class="aligncenter size-medium wp-image-3036" title="Modify the style" src="http://soderlind.no/wp-content/uploads/2011/12/webputty07-300x225.png" alt="" width="300" height="225" /></a><br />
I&#8217;ve written a simple <a href="http://wordpress.org/extend/plugins/webputty/">plugin</a> that allows you to modify your WordPress sites using <a href="http://www.webputty.net/">WebPutty</a>.</p>
<p><span id="more-3035"></span><br />
<strong>So what&#8217;s WebPutty?</strong></p>
<pre style="padding-left: 30px;"><a href="http://www.webputty.net/">WebPutty</a> is a simple CSS editing and hosting service.
WebPutty gives you a syntax-highlighting CSS editor you can use from anywhere, the power of <a href="http://sass-lang.com/">SCSS</a> and <a href="http://compass-style.org/">Compass</a>, a side-by-side preview pane, and instant publishing with minification, compression, and automatic cache control.</pre>
<p>There&#8217;s a <a href="http://youtu.be/FNaN789JsUc?hd=1">video at YouTube</a></p>
<p><strong>Integration</strong>:<br />
In WordPress, add the WebPutty integration code to your theme, or add it using my plugin. The integration code looks like:</p>
<pre class="brush: php; html-script: true; title: ; notranslate">
&lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;//webputty.commondatastorage.googleapis.com/[KEY].css&quot; /&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
(function(w,d){
	if(w.location!=w.parent.location||w.location.search.indexOf('__preview_css__')&gt;-1){
		var t=d.createElement('script');
		t.type='text/javascript';
		t.async=true;
		t.src='http://www.webputty.net/js/[KEY]';
		(d.body||d.documentElement).appendChild(t);
	}
})(window,document);
&lt;/script&gt;
</pre>
<p><strong>Plugin installtion and activation:</strong></p>
<ol>
<li>The plugin is available in the <a href="http://wordpress.org/extend/plugins/webputty/">WordPress Plugin Directory</a></li>
<li>Install and activate it.</li>
<li>Go to Settings -&gt; WebPutty Helper and add the integration code from <a href="http://www.webputty.net/">WebPutty</a> (see images below)</li>
</ol>
<p><strong>Integrating WebPutty and WordPress using my plugin:</strong><br />

<a href='http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/wepbutty01/' title='Add a new site'><img width="100" height="100" src="http://soderlind.no/wp-content/uploads/2011/12/wepbutty01-100x100.png" class="attachment-thumbnail" alt="Add a new site" title="Add a new site" /></a>
<a href='http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/webputty02/' title='Add name and URL'><img width="100" height="100" src="http://soderlind.no/wp-content/uploads/2011/12/webputty02-100x100.png" class="attachment-thumbnail" alt="Add name and URL" title="Add name and URL" /></a>
<a href='http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/webputty03/' title='Get code'><img width="100" height="100" src="http://soderlind.no/wp-content/uploads/2011/12/webputty03-100x100.png" class="attachment-thumbnail" alt="Get code" title="Get code" /></a>
<a href='http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/webputty04/' title='Copy the code'><img width="100" height="100" src="http://soderlind.no/wp-content/uploads/2011/12/webputty04-100x100.png" class="attachment-thumbnail" alt="Copy the code" title="Copy the code" /></a>
<a href='http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/webputty05/' title='Insert the code'><img width="100" height="100" src="http://soderlind.no/wp-content/uploads/2011/12/webputty05-100x100.png" class="attachment-thumbnail" alt="Insert the code" title="Insert the code" /></a>
<a href='http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/webputty06/' title='Reload the page at WebPutty'><img width="100" height="100" src="http://soderlind.no/wp-content/uploads/2011/12/webputty06-100x100.png" class="attachment-thumbnail" alt="Reload the page at WebPutty" title="Reload the page at WebPutty" /></a>
<a href='http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/webputty07/' title='Modify the style'><img width="100" height="100" src="http://soderlind.no/wp-content/uploads/2011/12/webputty07-100x100.png" class="attachment-thumbnail" alt="Modify the style" title="Modify the style" /></a>
</p>
<p><strong>Change log:</strong><br />
0.0.1: Initial version</p>
<p><strong>Todo:</strong></p>
<ul>
<li>Add option to remove local styles</li>
<li>Anything else? Please add your wishes as a comment below</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2011/12/20/wordpress-and-webputty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modernizr 101</title>
		<link>http://soderlind.no/archives/2011/11/24/modernizr-101/</link>
		<comments>http://soderlind.no/archives/2011/11/24/modernizr-101/#comments</comments>
		<pubDate>Thu, 24 Nov 2011 20:31:51 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=2962</guid>
		<description><![CDATA[.. or, why I like it. When developing for the web, I&#8217;ve always been a fan of checking for functionality using object detection, I NEVER try to detect which browser you are using. Modernizr does this much better that the other &#8230; <a href="http://soderlind.no/archives/2011/11/24/modernizr-101/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>.. or, why I like it.</p>
<p>When developing for the web, I&#8217;ve always been a fan of checking for functionality using <a href="http://www.quirksmode.org/js/support.html">object detection</a>, I NEVER try t<a href="http://www.quirksmode.org/js/detect.html">o detect which browser you are using</a>.</p>
<p><a href="http://www.modernizr.com/">Modernizr</a> does this much better that the other methods I&#8217;ve seen (and used).</p>
<p><span id="more-2962"></span></p>
<blockquote><p>Modernizr is a small JavaScript library that detects the availability of native implementations for next-generation web technologies, i.e. features that stem from the HTML5 and CSS3 specifications.</p>
<ol>
<li>It tests for over 40 next-generation features, all in a matter of milliseconds</li>
<li>It creates a JavaScript object (named <code>Modernizr</code>) that contains the results of these tests as boolean properties</li>
<li>It adds classes to the <code>html</code> element that explain precisely what features are and are <span style="color: #ff0000;">not</span> natively supported</li>
<li>It provides a script loader so you can pull in <a href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills">polyfills</a> to backfill functionality in old browsers</li>
</ol>
</blockquote>
<div>As stated above, Modernizr adds classes to the HTML tag, one per feature, pre-fixing the one that&#8217;s not supported in the browser with &#8220;no-&#8221;. This is the classes added to the HTML tag when I open a page in;</div>
<p><strong>Chrome 17.0.942.0 dev</strong>:</p>
<pre><span style="color: #008000;">&lt;html</span> <span style="color: #993300;">class=</span>" <span style="color: #0000ff;">js flexbox canvas canvastext webgl <span style="color: #ff0000;">no-touch</span> geolocation postmessage websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths</span>"<span style="color: #008000;">&gt;</span></pre>
<p><strong>Firefox 8.0.1</strong>:</p>
<pre><span style="color: #008000;">&lt;html</span> <span style="color: #993300;">class=</span>"<span style="color: #0000ff;"> js flexbox canvas canvastext webgl <span style="color: #ff0000;">no-touch</span> geolocation postmessage websqldatabase <span style="color: #ff0000;">no-indexeddb</span> hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients cssreflections csstransforms csstransforms3d csstransitions fontface video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg smil svgclippaths</span>"<span style="color: #008000;">&gt;</span></pre>
<p><strong>Safari 5.1.1 (7534.51.22)</strong>:</p>
<pre><span style="color: #008000;">&lt;html</span> <span style="color: #993300;">class</span>="<span style="color: #0000ff;">js flexbox canvas canvastext webgl <span style="color: #ff0000;">no-touch</span> geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop <span style="color: #ff0000;">no-websockets</span> rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients <span style="color: #ff0000;">no-cssreflections</span> csstransforms <span style="color: #ff0000;">no-csstransforms3d</span> csstransitions fontface video audio <span style="color: #ff0000;">no-localstorage</span> <span style="color: #ff0000;">no-sessionstorage</span> webworkers applicationcache svg inlinesvg smil svgclippaths</span>"<span style="color: #008000;">&gt;</span></pre>
<p><strong>IE9</strong></p>
<pre><span style="color: #008000;">&lt;html</span> <span style="color: #993300;">class</span>="<span style="color: #0000ff;">ie ie9 js <span style="color: #ff0000;">no-flexbox</span> canvas canvastext <span style="color: #ff0000;">no-webgl</span> <span style="color: #ff0000;">no-touch</span> geolocation postmessage <span style="color: #ff0000;">no-websqldatabase</span> <span style="color: #ff0000;">no-indexeddb</span> hashchange <span style="color: #ff0000;">no-history</span> draganddrop <span style="color: #ff0000;">no-websockets</span> rgba hsla multiplebgs backgroundsize <span style="color: #ff0000;">no-borderimage</span> borderradius boxshadow <span style="color: #ff0000;">no-textshadow</span> opacity <span style="color: #ff0000;">no-cssanimations</span> <span style="color: #ff0000;">no-csscolumns no-cssgradients no-cssreflections</span> csstransforms <span style="color: #ff0000;">no-csstransforms3d no-csstransitions</span> fontface video audio localstorage sessionstorage <span style="color: #ff0000;">no-webworkers no-applicationcache</span> svg inlinesvg smil svgclippaths</span>"<span style="color: #008000;">&gt;</span></pre>
<p>Lot&#8217;s of red for IE9, but this is not a &#8220;which brower is best&#8221; article, but how you can use Modernizr to give the user the experience expected which ever browser she is using today or tomorrow. Eg:</p>
<pre class="brush: css; title: ; notranslate">
.no-cssgradients .glossy { // Internet Explorer
    background: url(&quot;images/glossybutton.png&quot;);
}

.cssgradients .glossy {
    background-image: linear-gradient(top, #555, #333);
}
</pre>
<p>You can also use Modernizr to load the JavaScript <a href="https://github.com/Modernizr/Modernizr/wiki/HTML5-Cross-browser-Polyfills">libraries needed</a>:</p>
<pre class="brush: jscript; title: ; notranslate">
Modernizr.load({
  test: Modernizr.geolocation,
  yep : 'geo.js',
  nope: 'geo-polyfill.js'
});
</pre>
<p>A bit more advanced example</p>
<pre class="brush: jscript; title: ; notranslate">
// Give Modernizr.load a string, an object, or an array of strings and objects
Modernizr.load([
  // Presentational polyfills
  {
    // Logical list of things we would normally need
    test : Modernizr.fontface &amp;&amp; Modernizr.canvas &amp;&amp; Modernizr.cssgradients,
    // Modernizr.load loads css and javascript by default
    nope : ['presentational-polyfill.js', 'presentational.css']
  },
  // Functional polyfills
  {
    // This just has to be truthy
    test : Modernizr.websockets &amp;&amp; window.JSON,
    // socket-io.js and json2.js
    nope : 'functional-polyfills.js',
    // You can also give arrays of resources to load.
    both : [ 'app.js', 'extra.js' ],
    complete : function () {
      // Run this after everything in this group has downloaded
      // and executed, as well everything in all previous groups
      myApp.init();
    }
  },
  // Run your analytics after you've already kicked off all the rest
  // of your app.
  'post-analytics.js'
]);
</pre>
<p>Finally, to learn more about Modernizr and the philosophy behind it, you should watch this presentation by Faruk Ates, the creator of Modernizr:</p>
<p style="text-align: center;">[youtube]http://www.youtube.com/watch?v=n0q0kwiIPSY[/youtube]</p>
<p>Resources:</p>
<ul>
<li><a href="http://www.modernizr.com/docs/">Modernizr Documentation</a></li>
<li>A List Apart: <a href="http://www.alistapart.com/articles/taking-advantage-of-html5-and-css3-with-modernizr/">Taking Advantage of HTML5 and CSS3 with Modernizr</a></li>
<li>Web Designer Notebook: <a href="http://webdesignernotebook.com/css/how-to-use-modernizr/">How to use Modernizr</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2011/11/24/modernizr-101/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Front-end editor in WordPress 3.3 is easy</title>
		<link>http://soderlind.no/archives/2011/09/25/front-end-editor-in-wordpress-3-3/</link>
		<comments>http://soderlind.no/archives/2011/09/25/front-end-editor-in-wordpress-3-3/#comments</comments>
		<pubDate>Sun, 25 Sep 2011 10:47:31 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[general]]></category>
		<category><![CDATA[wp-plugins]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=1866</guid>
		<description><![CDATA[Thanks to the work done by Andrew Ozz et al., adding a front-end editor in WordPress 3.3 is very simple. Syntax: So the simplest one is: Want better control?: Don&#8217;t want the quick tags?: Or you can do: Notes (from &#8230; <a href="http://soderlind.no/archives/2011/09/25/front-end-editor-in-wordpress-3-3/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Thanks to the <a href="http://core.trac.wordpress.org/ticket/17144">work done by Andrew Ozz</a> et al., adding a front-end editor in WordPress 3.3 is very simple.</p>
<p>Syntax:</p>
<pre class="brush: php; title: ; notranslate">
wp_editor( $content, $editor_id, $settings = array() );

// default settings
$settings =   array(
	'wpautop' =&gt; true, // use wpautop?
	'media_buttons' =&gt; true, // show insert/upload button(s)
	'textarea_name' =&gt; $editor_id, // set the textarea name to something different, square brackets [] can be used here
	'textarea_rows' =&gt; get_option('default_post_edit_rows', 10), // rows=&quot;...&quot;
	'tabindex' =&gt; '',
	'editor_css' =&gt; '', // intended for extra styles for both visual and HTML editors buttons, needs to include the &lt;style&gt; tags, can use &quot;scoped&quot;.
	'editor_class' =&gt; '', // add extra class(es) to the editor textarea
	'teeny' =&gt; false, // output the minimal editor config used in Press This
	'dfw' =&gt; false, // replace the default fullscreen with DFW (needs specific css)
	'tinymce' =&gt; true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
	'quicktags' =&gt; true // load Quicktags, can be used to pass settings directly to Quicktags using an array()
);
</pre>
<p><span id="more-1866"></span><br />
So the simplest one is:</p>
<pre class="brush: php; title: ; notranslate">
echo '&lt;form action=&quot;&quot; method=&quot;post&quot; target=&quot;_blank&quot;&gt;';
wp_editor('&lt;p&gt;Some content&lt;/p&gt;', 'textarea01' );
echo '&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/form&gt;'
</pre>
<p>Want better control?:</p>
<pre class="brush: php; title: ; notranslate">
$settings = array(
	'wpautop' =&gt; true,
	'media_buttons' =&gt; false,
	'tinymce' =&gt; array(
		'theme_advanced_buttons1' =&gt; 'bold,italic,underline,blockquote,|,undo,redo,|,fullscreen',
		'theme_advanced_buttons2' =&gt; '',
		'theme_advanced_buttons3' =&gt; '',
		'theme_advanced_buttons4' =&gt; ''
	),
	'quicktags' =&gt; array(
		'buttons' =&gt; 'b,i,ul,ol,li,link,close'
	)
);

echo '&lt;form action=&quot;&quot; method=&quot;post&quot; target=&quot;_blank&quot;&gt;';
wp_editor('&lt;p&gt;Some more content&lt;/p&gt;', 'textarea02', $settings );
echo '&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/form&gt;';
</pre>
<p>Don&#8217;t want the quick tags?:</p>
<pre class="brush: php; title: ; notranslate">
$settings = array(
	'wpautop' =&gt; true,
	'media_buttons' =&gt; false,
	'tinymce' =&gt; array(
		'theme_advanced_buttons1' =&gt; 'bold,italic,underline,blockquote,|,undo,redo,|,fullscreen',
		'theme_advanced_buttons2' =&gt; '',
		'theme_advanced_buttons3' =&gt; '',
		'theme_advanced_buttons4' =&gt; ''
	),
	'quicktags' =&gt; false
);

echo '&lt;form action=&quot;&quot; method=&quot;post&quot; target=&quot;_blank&quot;&gt;';
wp_editor('&lt;p&gt;Some more content&lt;/p&gt;', 'textarea02', $settings );
echo '&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/form&gt;';
</pre>
<p>Or you can do:</p>
<pre class="brush: php; title: ; notranslate">
add_filter( 'teeny_mce_buttons',tinytiny_buttons);

$settings = array(&quot;teeny&quot;=&gt;true,'media_buttons' =&gt; false,'quicktags' =&gt; false);

echo '&lt;form action=&quot;&quot; method=&quot;post&quot; target=&quot;_blank&quot;&gt;';
wp_editor('&lt;p&gt;Some more content&lt;/p&gt;', 'textarea04', $settings );
echo '&lt;input type=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/form&gt;';

function tinytiny_buttons($buttons) {
	return array('bold', 'italic', 'underline', 'blockquote', 'separator', 'undo', 'redo', 'fullscreen');
}
</pre>
<p><strong>Notes</strong> (from the <a href="http://codex.wordpress.org/Function_Reference/wp_editor">codex</a>)</p>
<p>Note that the ID that is passed to the wp_editor() function can only be comprised of lower-case letters. No underscores, no hyphens. Anything else will cause the WYSIWYG editor to malfunction.</p>
<p>Once instantiated, the WYSIWYG editor cannot be moved around in the DOM. What this means in practical terms, is that you cannot put it in meta-boxes that can be dragged and placed elsewhere on the page</p>
<p><strong>More information</strong><br />
wp_editor() is located in <a href="http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/general-template.php#L1786">wp-includes/general-template.php</a><br />
The default settings are defined in <a href="http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/class-wp-editor.php#L31">wp-includes/class-wp-editor.php</a><br />
I&#8217;ve also added several examples in the <a href="#comments">comments below</a></p>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2011/09/25/front-end-editor-in-wordpress-3-3/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
		<item>
		<title>Running WordPress locally on Mac OS X Lion</title>
		<link>http://soderlind.no/archives/2011/08/26/running-wordpress-locally-on-mac-os-x-lion/</link>
		<comments>http://soderlind.no/archives/2011/08/26/running-wordpress-locally-on-mac-os-x-lion/#comments</comments>
		<pubDate>Fri, 26 Aug 2011 01:45:34 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[tools]]></category>
		<category><![CDATA[Installation]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[MAMP]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=1810</guid>
		<description><![CDATA[Want to run WordPress on OSX? I&#8217;ve wanted to do it for a long time and finally got a round to do it. 1 ) Installed Apache, MySQL and PHP on my Mac. I followed this excellent guide: OS X &#8230; <a href="http://soderlind.no/archives/2011/08/26/running-wordpress-locally-on-mac-os-x-lion/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><img src="http://soderlind.no/wp-content/uploads/2011/08/AppleWP1-300x128.png" alt="" title="Apple and WordPress" width="300" height="128" class="aligncenter size-medium wp-image-1839" /><br />
Want to run WordPress on OSX? I&#8217;ve wanted to do it for a long time and finally got a round to do it. </p>
<p><span id="more-1810"></span></p>
<p>1 ) Installed Apache, MySQL and PHP on <a href="http://soderlind.no/archives/2008/10/04/my-digital-tool-chest/">my Mac</a>. I followed this excellent guide: <a href="http://echodittolabs.org/blog/2011/08/os-x-107-lion-development-native-mamp-mysql-installer">OS X 10.7 Lion Development: Native MAMP with MySQL installer</a>. Here&#8217;s the /Users/&lt;username&gt;/Sites/httpd-vhosts.conf I made:</p>
<pre class="brush: xml; title: ; notranslate">
#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# Set up permissions for VirtualHosts in ~/Sites
#
&lt;Directory &quot;/Users/&lt;username&gt;/Sites&quot;&gt;
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
&lt;/Directory&gt;

# For http://localhost in the OS X default location
&lt;VirtualHost _default_:80&gt;
    ServerName localhost
    DocumentRoot /Library/WebServer/Documents
&lt;/VirtualHost&gt;

#
# VirtualHosts below
#

# wp.local
&lt;VirtualHost *:80&gt;
    ServerName wp.local
    CustomLog &quot;/Users/&lt;username&gt;/Sites/logs/wp.local-access_log&quot; combined
    ErrorLog &quot;/Users/&lt;username&gt;/Sites/logs/wp.local-error_log&quot;
    DocumentRoot &quot;/Users/&lt;username&gt;/Sites/wordpress&quot;
&lt;/VirtualHost&gt;
</pre>
<p>2) <a href="http://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install">Installed WordPress</a> in /Users/&lt;username&gt;/Sites/wordpress</p>
<p>When I tried to install the first plugin, I got the dreaded <strong>FTP Connection Information required :/</strong></p>
<p><img class="aligncenter size-medium wp-image-1811" title="connection_info_needed" src="http://soderlind.no/wp-content/uploads/2011/08/connection_info_needed-300x167.jpg" alt="" width="300" height="167" /></p>
<p>Luckily, <a href="http://www.google.com/search?q=wordpress+mac+osx+lion">Google to the rescue</a>, I found this fix to allow WordPress automatic plugin installation/update:</p>
<p>A) Changed the owner and permissions for the entire WordPress installation, assuming you installed WordPress in /Users/&lt;username&gt;/Sites:</p>
<pre class="brush: bash; light: false; title: ; notranslate">
$ cd /Users/&lt;username&gt;/Sites
$ sudo chown -R :_www wordpress
$ sudo chmod -R g+w wordpress
</pre>
<p>B) Added the following to /Users/&lt;username&gt;/Sites/wordpress/wp-config.php:</p>
<pre class="brush: php; title: ; notranslate">
define('FS_METHOD', 'direct');
</pre>
<p>Running WordPress locally makes it much easier to develop <a href="http://soderlind.no/wordpress-plugin-template-creator/">WordPress plugins</a> wherever you are <img src='http://soderlind.no/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2011/08/26/running-wordpress-locally-on-mac-os-x-lion/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Upgraded to WordPress 3.2 and nothing worked (internal error &#8230;)</title>
		<link>http://soderlind.no/archives/2011/07/05/upgraded-to-wordpress-3-2-and-nothing-worked-internal-error/</link>
		<comments>http://soderlind.no/archives/2011/07/05/upgraded-to-wordpress-3-2-and-nothing-worked-internal-error/#comments</comments>
		<pubDate>Mon, 04 Jul 2011 22:43:38 +0000</pubDate>
		<dc:creator>PerS</dc:creator>
				<category><![CDATA[general]]></category>

		<guid isPermaLink="false">http://soderlind.no/?p=1784</guid>
		<description><![CDATA[Luckily I log all PHP errors and the error log told me where the error was (an old plugin I&#8217;ve forgotten to remove) .. phew To log errors, I have the following statement at the top of my wp-config.php:]]></description>
			<content:encoded><![CDATA[<p>Luckily I log all PHP errors and the error log told me where the error was (an old plugin I&#8217;ve forgotten to remove) .. phew</p>
<p>To log errors, I have the following statement at the top of my wp-config.php:</p>
<pre class="brush: php; title: ; notranslate">@ini_set('log_errors','On');
@ini_set('display_errors','Off');
@ini_set('error_log','/PATH/log/php_errors.'.date('Y-m-d').'.log');</pre>
]]></content:encoded>
			<wfw:commentRss>http://soderlind.no/archives/2011/07/05/upgraded-to-wordpress-3-2-and-nothing-worked-internal-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

