<?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>Toby&#039;s Technical Ramblings &#187; Wordpress</title> <atom:link href="http://tosbourn.com/category/wordpress/feed/" rel="self" type="application/rss+xml" /><link>http://tosbourn.com</link> <description>A web development blog.</description> <lastBuildDate>Mon, 06 Feb 2012 15:08:08 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Accessing PHP variables from within JavaScript under WordPress</title><link>http://tosbourn.com/2011/08/wordpress/accessing-php-variables-from-within-javascript-under-wordpress/</link> <comments>http://tosbourn.com/2011/08/wordpress/accessing-php-variables-from-within-javascript-under-wordpress/#comments</comments> <pubDate>Mon, 22 Aug 2011 19:36:36 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[JavaScript]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Wordpress]]></category><guid
isPermaLink="false">http://tosbourn.com/?p=523</guid> <description><![CDATA[Accessing PHP variables from within JavaScript under WordPress is so easy it is almost trivial.  Having said that, I didn&#8217;t know there was a way to do it until I asked on the WordPress StackExchange site. I will show you what you need to do by way of an example.  Let us suppose we need [...]]]></description> <content:encoded><![CDATA[<p>Accessing PHP variables from within JavaScript under WordPress is so easy it is almost trivial.  Having said that, I didn&#8217;t know there was a way to do it until I <a
href="http://wordpress.stackexchange.com/questions/26570/javascript-helpers" target="_blank">asked on the WordPress StackExchange site</a>.</p><p>I will show you what you need to do by way of an example.  Let us suppose we need the site URL in our JavaScript code.</p><p>It is a two step process, the first step is in your PHP;</p><pre>wp_enqueue_script('my_script');
$data = array('site_url' =&gt; __(site_url()));
wp_localize_script('my_script', 'php_data', $data);</pre><p>So what we have done there is enqueued our script (named here, my_script) and once we have done that we set up our data array. In our case the property is site_url and it&#8217;s contents are going to be the result of site_url(). Once we have that we can call wp_localize_script, into it we pass the name of our script, the name we want to give our JavaScript object and the data we want to pass in.</p><p>Next we want to be able to access the data, so in your JavaScript file you can simply call the following (if you wanted to alert out the site URL!)</p><pre>alert(php_data.site_url);</pre><p>Really, really easy and really, really handy!</p><p>For more information please see the <a
title="Function Reference" href="http://codex.wordpress.org/Function_Reference/wp_localize_script" target="_blank">official reference</a>.</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2011/08/wordpress/accessing-php-variables-from-within-javascript-under-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Gotta love the google font API</title><link>http://tosbourn.com/2010/05/design/gotta-love-the-google-font-api/</link> <comments>http://tosbourn.com/2010/05/design/gotta-love-the-google-font-api/#comments</comments> <pubDate>Wed, 19 May 2010 22:03:52 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Design]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[Fonts]]></category> <category><![CDATA[Google]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=246</guid> <description><![CDATA[I had read some tweets earlier today about the Google Font API and thought I would check it out. Normally the way these things go down is I view the demos and have every intention of trying it myself but there are usually just a couple too many steps involved for the time I have allotted to [...]]]></description> <content:encoded><![CDATA[<p>I had read some tweets earlier today about the <a
href="http://code.google.com/webfonts">Google Font API</a> and thought I would check it out.</p><p>Normally the way these things go down is I view the demos and have every intention of trying it myself but there are usually just a couple too many steps involved for the time I have allotted to dicking around the interwebs but this was so quick and so straight forward that I have eliminated cufon from this site in about 5 minutes.</p><p>Here are the steps I used;</p><ol><li>Follow the link above.</li><li>Click on the font you want.</li><li>Click get the code.</li><li>Copy and paste the link into the head of your page.</li><li>Update your CSS with a copy/paste.</li><li>Done! (well, I also had to jump onto WordPress and turn off Cufon in a settings page, but that is specific to my template.)</li></ol><p>I am not a designer so I don&#8217;t really know if those fonts are any good or not from a design point of view, but the potential for breaking away from the standard websafe fonts is huge!</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2010/05/design/gotta-love-the-google-font-api/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Adding jQuery to WordPress</title><link>http://tosbourn.com/2009/11/wordpress/adding-jquery-to-wordpress/</link> <comments>http://tosbourn.com/2009/11/wordpress/adding-jquery-to-wordpress/#comments</comments> <pubDate>Fri, 27 Nov 2009 22:37:36 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[jQuery]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=202</guid> <description><![CDATA[For my last post (talking about a really cool jQuery plugin) I really wanted to display the talked about effect on the site, not least because I wanted to play about with it some! In order to do that I had to make some changes to my theme, which I figured I should document. I [...]]]></description> <content:encoded><![CDATA[<p><img
class="alignright" src="http://i151.photobucket.com/albums/s130/tosbourn/jquery_logo.png" alt="Adding jQuery to WordPress" />For my last post (talking about a <a
href="http://www.tosbourn.com/2009/11/inframe-dynamic-iframe-creation-with-jquery/">really cool jQuery plugin</a>) I really wanted to display the talked about effect on the site, not least because I wanted to play about with it some!</p><p>In order to do that I had to make some changes to my theme, which I figured I should document.</p><p>I went into my theme directory and created /js/themename.js</p><p>I edited the header (themename/header.php) to include jQuery and /js/themename.js&#8230;</p><p>&lt;script src=&#8221;&lt;?php bloginfo(&#8216;stylesheet_directory&#8217;); ?&gt;/js/jquery-1.3.2.min.js&#8221; type=&#8221;text/javascript&#8221; &gt;&lt;/script&gt;<br
/> &lt;script src=&#8221;&lt;?php bloginfo(&#8216;stylesheet_directory&#8217;); ?&gt;/js/lightword.js&#8221; type=&#8221;text/javascript&#8221; &gt;&lt;/script&gt;</p><p>Inside of themename.js I created my $(document).ready() call and gave it the code it required.</p><p>I uploaded /themename/header.php, /themename/js/themename.js and themename/js/jquery-1.3.2.min.js to the site.</p><p>That is it!</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2009/11/wordpress/adding-jquery-to-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>WordPress Cheat Sheet</title><link>http://tosbourn.com/2009/09/wordpress/wordpress-cheat-sheet/</link> <comments>http://tosbourn.com/2009/09/wordpress/wordpress-cheat-sheet/#comments</comments> <pubDate>Sun, 13 Sep 2009 11:27:51 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[Cheat Sheets]]></category> <category><![CDATA[Ekin Ertac]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=145</guid> <description><![CDATA[I found this sheet last night and have already made use of it.  This PDF document lists all of the common WordPress functions and whilst it isn&#8217;t as comprehensive as it could be it is certainly a handy thing to have about when a function name is on the tip of your tongue! Download the [...]]]></description> <content:encoded><![CDATA[<p>I found this sheet last night and have already made use of it.  This <acronym
title="Portable Document Format">PDF</acronym> document lists all of the common WordPress functions and whilst it isn&#8217;t as comprehensive as it could be it is certainly a handy thing to have about when a function name is on the tip of your tongue!</p><p><a
href="http://ekinertac.com/?p=259">Download the cheat sheet from Ekin Ertac</a>.</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2009/09/wordpress/wordpress-cheat-sheet/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>A/B Testing with WordPress</title><link>http://tosbourn.com/2009/08/wordpress/ab-testing-with-wordpress/</link> <comments>http://tosbourn.com/2009/08/wordpress/ab-testing-with-wordpress/#comments</comments> <pubDate>Mon, 10 Aug 2009 22:28:26 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[A/B Testing]]></category> <category><![CDATA[Ryan Carson]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=112</guid> <description><![CDATA[Here is an excellent video from Ryan Carson on how to quickly set up and start using an A/B Testing plugin for WordPress. How to do A/B Testing with WordPress from Carsonified on Vimeo. The importance of A/B testing really can&#8217;t be overstated enough, it is one of those things that you really don&#8217;t think [...]]]></description> <content:encoded><![CDATA[<p>Here is an excellent video from Ryan Carson on how to quickly set up and start using an A/B Testing plugin for WordPress.</p><p><object
width="400" height="300"><param
name="allowfullscreen" value="true" /><param
name="allowscriptaccess" value="always" /><param
name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5775819&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed
src="http://vimeo.com/moogaloop.swf?clip_id=5775819&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><p><a
href="http://vimeo.com/5775819">How to do A/B Testing with WordPress</a> from <a
href="http://vimeo.com/carsonified">Carsonified</a> on <a
href="http://vimeo.com">Vimeo</a>.</p><p>The importance of A/B testing really can&#8217;t be overstated enough, it is one of those things that you really don&#8217;t think has the type of effects that other people talk about until you try it yourself.  And with tools like this making it stupidly easy to do this kind of testing there is really no excuse.</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2009/08/wordpress/ab-testing-with-wordpress/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Out of the box design</title><link>http://tosbourn.com/2009/06/design/out-of-the-box-design/</link> <comments>http://tosbourn.com/2009/06/design/out-of-the-box-design/#comments</comments> <pubDate>Mon, 29 Jun 2009 21:24:02 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Design]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[Themes]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=16</guid> <description><![CDATA[Before setting up this blog I had spent a fair amount of time mulling over how I should style this blog.  The three options are obvious; Create a style from scratch Use a free theme and heavily modify it Just use a free theme I thought I would take some time put my thought process [...]]]></description> <content:encoded><![CDATA[<p>Before setting up this blog I had spent a fair amount of time mulling over how I should style this blog.  The three options are obvious;</p><ol><li>Create a style from scratch</li><li>Use a free theme and heavily modify it</li><li>Just use a free theme</li></ol><p>I thought I would take some time put my thought process on paper and share it with you.</p><ul><li><strong>Create a style from scratch</strong></li></ul><p>Creating a style from scratch is easily the hardest one to complete, however potentially the most rewarding.  You could really get your teeth into the code that WordPress uses and you could really push the boat out with bells and whistles.  At the very start I thought this was the road I wanted to go down.  I have been under the hood of WordPress many times making both small cosmetic and functional changes, but I have never had to sit down with any part of it from scratch and work my way up, and I thought this would be an excellent challenge.</p><p>The main thing that stopped me from doing this was creative ability and the need to get something up and running quickly.  I am not a graphics designer, it is something I am trying to improve upon but at the moment I only have the most basic knowledge of what makes a good design.  I didn&#8217;t think it would be fair on my 3 readers to have them endure endless changes to the layout whilst my technique improved.</p><ul><li><strong>Use a free theme and heavily modify it</strong></li></ul><p>I have seen this being done a lot and with very mixed results.  I dismissed this out of hand because I think in the time it takes to heavily modify a theme (by which I mean change it enough so as to make it your own) then I think you may as well of started from scratch, it seems fairly lazy in my opinion to take the foundations of what someone has made then chop and change it to suit yourself.</p><ul><li><strong>Just use a free theme</strong></li></ul><p>This is most definitely the laziest option, however it is also the one I went for and the one I am going to defend (not that I feel I really need to!) here.</p><p>Using a free theme has many advantages; you can install it and have it set up in literally a couple of minutes, all the browser testing as (hopefully) already been completed, you can get all the benefits of have a good designer work on your site but without any associated costs.</p><p>It also has a couple of disadvantages; You learn nothing, you end up with a site that is bound to look like at least 100 others.</p><p>I am going to sidestep the learning nothing issue by promising myself that I will be making my own design from scratch someday.</p><p>I am going to do a couple of things regarding the fact my site will look the same as others, the first is that I plan to make minor changes, whilst overall I am happy with the theme there are a couple of small things I want to change.  I don&#8217;t think this counts in any way as heavily modifying the site and it will stay true to what the <a
href="http://students.info.uaic.ro/~andrei.luca/">original designer</a> had in mind for it.  The second thing I am going to do about this disadvantage is point out that this is a lovely theme and there are at least 100 other blogs that look damn fine!</p><p>Did I make the right choice? Let me know in the comments!</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2009/06/design/out-of-the-box-design/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Not Another Blog</title><link>http://tosbourn.com/2009/06/other/not-another-blog/</link> <comments>http://tosbourn.com/2009/06/other/not-another-blog/#comments</comments> <pubDate>Sun, 28 Jun 2009 20:56:33 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Other]]></category> <category><![CDATA[Wordpress]]></category> <category><![CDATA[Me]]></category> <category><![CDATA[Team Solutionz]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=5</guid> <description><![CDATA[Personally speaking I barely have room on my RSS reader for any more web development / design blogs and I am running out of hours in the day to give all of the content I receive a proper read, so why would I dare to think that adding my own little stream of bloggy goodness [...]]]></description> <content:encoded><![CDATA[<p>Personally speaking I barely have room on my RSS reader for any more web development / design blogs and I am running out of hours in the day to give all of the content I receive a proper read, so why would I dare to think that adding my own little stream of bloggy goodness into the fold is going to do anything other than get ignored after the first 10 minutes of me spamming it on twitter?</p><p>Well the short answer is because I can, with the wonders of wordpress and a decent hosting company I had the space made, the domain bought and paid for and the blog installed in literally 30 minutes (and that included checking my emails, other general internetting and changing a record on my eld vinyl player).</p><p>The slightly longer answer is that I have wanted to create something like this for a very long time, I love what I do and I have found that I like to write about things I love to do.  The main issue I have is that I love to do a lot of things, which means I love to write about a lot of things, which means I have my fingers in many pies, which means I often waste evenings doing things on no consequence on some of my smaller sites.  This all changed however when somehow I managed to convince the directors in my work that allowing me to write a web development blog would be an excellent objective for the year &#8211; which gave me an excellent incentive to actually do it.</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2009/06/other/not-another-blog/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Served from: tosbourn.com @ 2012-02-07 03:45:35 by W3 Total Cache -->
