<?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>memeLab &#187; theme design</title>
	<atom:link href="http://memelab.com.au/tag/theme-design/feed/" rel="self" type="application/rss+xml" />
	<link>http://memelab.com.au</link>
	<description>Search Engine Marketing and Web Publishing Services</description>
	<lastBuildDate>Mon, 16 Apr 2012 03:12:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Add a Download link to the 1pixelout Audio Player</title>
		<link>http://memelab.com.au/add-download-link-to-1pixelout-audio-player/</link>
		<comments>http://memelab.com.au/add-download-link-to-1pixelout-audio-player/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 08:11:33 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[audio]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[theme design]]></category>

		<guid isPermaLink="false">http://memelab.com.au/?p=82</guid>
		<description><![CDATA[<p><p><a href="http://http://memelab.com.au/">Wordpress Customisation Melbourne</a></p><p>I love the WordPress plugin Audio Player by 1pixelout, and highly recommend it to folk who want to present audio on their site.  I&#8217;d like to be able to offer the file for download too, though, so I&#8217;ve created a little download icon that sits beside the player. Here&#8217;s a demo: luscious-woman-afoot To set the [...]</p></p><p><a href="http://http://memelab.com.au/">Wordpress Training Melbourne</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://http://memelab.com.au/">Wordpress Customisation Melbourne</a></p><p>I love the WordPress plugin Audio Player by 1pixelout, and highly recommend it to folk who want to present audio on their site.  I&#8217;d like to be able to offer the file for download too, though, so I&#8217;ve created a little download icon that sits beside the player.<span id="more-82"></span></p>
<p>Here&#8217;s a demo:</p>
<p><a class="audio-download" title="Right Click and 'Save As' to download" href="http://memelab.com.au/wp-content/uploads/luscious-woman-afoot.mp3">luscious-woman-afoot</a></p>
<h3>To set the effect up:</h3>
<ul>
<li>upload the icon to your theme&#8217;s images/ folder</li>
<li>add the following code to your theme&#8217;s stylesheet</li>
<li>insert the link in to your post with the audio
<ul>
<li>Upload</li>
<li>Edit the Link</li>
<li>Insert the audio quicktag</li>
</ul>
</li>
</ul>
<h3>Upload the audio:</h3>
<ul>
<li>Open up your post</li>
<li>Click Add Audio</li>
<li>Browse to the track on your hard drive, and select Insert into Post</li>
</ul>
<p>You should now have a text link in your post which points to the audio file.</p>
<h3>Edit the Link:</h3>
<ul>
<li>click the link that you&#8217;ve inserted, then the Insert/Edit Link button (which looks like a chain)</li>
<li>type a title like &#8220;Right Click and &#8216;Save As&#8217; to download this file&#8221;</li>
<li>switch to HTML mode, and add the class &#8220;<strong>audio-download&#8221;</strong> to the link:</li>
</ul>
<pre>&lt;a <strong>class="audio-download" </strong>title="Right Click and 'Save As' to download" href="http://mysite.com.au/wp-content/uploads/my-audio-filename-goes-here.mp3"&gt;</pre>
<p id="post-56" class="entrytitle">Tip: I use the really handy <a title="TinyMCE Advanced plugin" href="http://www.laptoptips.ca/projects/tinymce-advanced/" target="_blank">TinyMCE Advanced</a> plugin, so I replace that last step with:</p>
<ul>
<li>Click on the Advanced tab in the link dialog</li>
<li>enter <strong>audio-download</strong> into the classes field</li>
</ul>
<h3>Insert the audio player quicktag:</h3>
<ul>
<li>position the cursor after the link you&#8217;ve inserted</li>
<li>type: <strong>[ audio:my-audio-filename-goes-here.mp3]</strong>
<ul>
<li><em>I&#8217;ve added a space after the first square bracket: be sure to remove it, and be careful not to leave any spaces after the colon!</em></li>
</ul>
</li>
</ul>
<p>The stylesheet code:</p>
<pre class="brush:css">.audio-download {
	background: url("images/audio-download.png") no-repeat scroll 0 0 transparent;
    float: left;
    width: 29px; height: 24px;
	margin-right: 5px;

    text-decoration: none;
    text-indent: -999in;
}
.audio-download:hover {
	background-position: 0 -24px;
}</pre>
<p>The download icon used in this tutorial:</p>
<p><a href="http://memelab.com.au/wp-content/uploads/download-audio.png"><img class="alignnone size-medium wp-image-87" title="download-audio.png" src="http://memelab.com.au/wp-content/uploads/download-audio.png" alt="The icon used in this tutorial" /></a></p>
<p>Enjoy!</p>
<p><a href="http://http://memelab.com.au/">Wordpress Training Melbourne</a></p>]]></content:encoded>
			<wfw:commentRss>http://memelab.com.au/add-download-link-to-1pixelout-audio-player/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
<enclosure url="http://memelab.com.au/wp-content/uploads/luscious-woman-afoot.mp3" length="137589" type="audio/mpeg" />
<enclosure url="http://mysite.com.au/wp-content/uploads/my-audio-filename-goes-here.mp3" length="111" type="audio/mpeg" />
		</item>
		<item>
		<title>Custom Header Image for WordPress Themes</title>
		<link>http://memelab.com.au/custom-header-image-for-wordpress-themes/</link>
		<comments>http://memelab.com.au/custom-header-image-for-wordpress-themes/#comments</comments>
		<pubDate>Fri, 28 Nov 2008 03:38:06 +0000</pubDate>
		<dc:creator>tim</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[customisation]]></category>
		<category><![CDATA[functions.php]]></category>
		<category><![CDATA[theme design]]></category>

		<guid isPermaLink="false">http://memelab.com.au/?p=71</guid>
		<description><![CDATA[<p><p><a href="http://http://memelab.com.au/">Wordpress Customisation Melbourne</a></p><p>A client wanted to be able to set a different header image for each page or post on his WordPress site, so I&#8217;ve written this function for him. He can now set a custom image for each page header in a few steps: upload the cropped custom images via FTP set the custom field &#8220;header&#8221; [...]</p></p><p><a href="http://http://memelab.com.au/">Wordpress Training Melbourne</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://http://memelab.com.au/">Wordpress Customisation Melbourne</a></p><p>A client wanted to be able to set a different header image for each page or post on his WordPress site, so I&#8217;ve written this function for him.</p>
<p>He can now set a custom image for each page header in a few steps:</p>
<ul>
<li>upload the cropped custom images via FTP</li>
<li>set the custom field &#8220;header&#8221; in the relevant posts</li>
</ul>
<p><span id="more-71"></span></p>
<h3>Set up..</h3>
<p>You&#8217;ll need to create the folder /wp-content/uploads/<strong>header</strong>/ and upload your default image into it.</p>
<p>The following function belongs in your theme&#8217;s <strong>functions.php</strong> file (you can create it if it doens&#8217;t already exist).  You&#8217;ll also need to check that your theme includes the wordpress function <strong>wp_head()</strong> in your <strong>header.php</strong> file.</p>
<p>Change the value <strong>my_default_image.jpg</strong> to the name of the file you uploaded.  <em>Tip: for simplicity&#8217;s sake, don&#8217;t use spaces in the filename.</em></p>
<pre class="php" name="code">function get_custom_header() {

	global $post;

	$error_level	 = error_reporting();
	$default_folder	 = "/wp-content/uploads/header/";
	$default_image	 = "my_default_image.jpg";
	$header		 = get_post_meta($post-&gt;ID, 'header', true);
	$file		 = ABSPATH.$default_folder.$header;

	// if nothing is defined, use the default
	$header_image	 = $default_image;

	// is the field defined?
	if($header != '')

		// does the file exist?
		if(file_exists($file)) {

			// getimagesize() returns an error if the file is not an image.. keep it quiet
			error_reporting(0);

			// is it really an image?
			if(getimagesize($file))
				$header_image = $header;

			error_reporting($error_level);
		}

	print "\n\n&lt;!-- Custom Header Image by http://memeLab.com.au --&gt;\n";
	print "&lt;style&gt;&lt;!-- #logo {background: url(" . $default_folder . $header_image . ") no-repeat left top;} --&gt;&lt;/style&gt;\n\n";
}
add_action('wp_head', 'get_custom_header');</pre>
<h3>What it does:</h3>
<p>The function:</p>
<ul>
<li>checks whether a custom image was set</li>
<li>ensures that the file exists, and is actually an image</li>
<li>only sets the custom header if both of these conditions is true</li>
</ul>
<p>The challenge here was in testing to see if the file was an image: the best php functions for the job are probably finfo() or exif_imagetype(), but they weren&#8217;t available on my client&#8217;s server, so I used getimagesize() instead.  Unfortunately, getimagesize() prints a warning rather than returning an errorcode if the file is not an imageimage, so I silenced the possible warning by setting then restoring error_reporting().</p>
<p>Of course, it can be said that a production server shouldn&#8217;t print errors, but that wasn&#8217;t my call here.</p>
<p>This function was developed for WordPress 2.6.3, but should run fine on anything after 2.5.1.</p>
<p><a href="http://http://memelab.com.au/">Wordpress Training Melbourne</a></p>]]></content:encoded>
			<wfw:commentRss>http://memelab.com.au/custom-header-image-for-wordpress-themes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

