<?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/tag/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>Hacked.</title><link>http://tosbourn.com/2011/07/security/hacked/</link> <comments>http://tosbourn.com/2011/07/security/hacked/#comments</comments> <pubDate>Thu, 07 Jul 2011 22:30:02 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Security]]></category> <category><![CDATA[Hacked]]></category> <category><![CDATA[Wordpress]]></category><guid
isPermaLink="false">http://tosbourn.com/?p=472</guid> <description><![CDATA[Some arse seemingly managed to get hold of my FTP password for this site and put some dodgy Javascript into the index.php file. I have completely re-installed WordPress (I had to do an update anyway) and have changed all my related credentials. My most sincere apologies to anyone who may have been sent somewhere as [...]]]></description> <content:encoded><![CDATA[<p>Some arse seemingly managed to get hold of my FTP password for this site and put some dodgy Javascript into the index.php file.  I have completely re-installed WordPress (I had to do an update anyway) and have changed all my related credentials.</p><p>My most sincere apologies to anyone who may have been sent somewhere as a result of visiting this site in the past few days and my genuine gratitude to the kind people who reported the issue.</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2011/07/security/hacked/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>New Layout</title><link>http://tosbourn.com/2011/05/other/new-layout/</link> <comments>http://tosbourn.com/2011/05/other/new-layout/#comments</comments> <pubDate>Fri, 27 May 2011 13:06:00 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Other]]></category> <category><![CDATA[Wordpress]]></category><guid
isPermaLink="false">http://tosbourn.com/?p=443</guid> <description><![CDATA[Last night I chucked a new layout onto the site to replace the old one which wasn&#8217;t brilliant and was starting to annoy me. I do have my own in development at the moment but until I find the time to finish it I guess this will do! Comments are welcomed!]]></description> <content:encoded><![CDATA[<p>Last night I chucked a new layout onto the site to replace the old one which wasn&#8217;t brilliant and was starting to annoy me.</p><p>I do have my own in development at the moment but until I find the time to finish it I guess this will do!</p><p>Comments are welcomed!</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2011/05/other/new-layout/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Some pretty awesome web dev links.</title><link>http://tosbourn.com/2010/11/development/some-pretty-awesome-web-dev-links/</link> <comments>http://tosbourn.com/2010/11/development/some-pretty-awesome-web-dev-links/#comments</comments> <pubDate>Mon, 15 Nov 2010 20:00:30 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Development]]></category> <category><![CDATA[jQuery]]></category> <category><![CDATA[Links]]></category> <category><![CDATA[Twitter]]></category> <category><![CDATA[Wordpress]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=355</guid> <description><![CDATA[Here are some links I favourited today on Twitter, thought I would share. How to Protect Your WordPress Blog From Getting Hacked &#8211; Pretty self explanatory, unlike a lot of WordPress related posts, this isn&#8217;t just a list of plugins that are flavour of the month (although it does suggest some). An excellent read and essential [...]]]></description> <content:encoded><![CDATA[<p>Here are some links I favourited today on Twitter, thought I would share.</p><ul><li><a
href="http://www.onextrapixel.com/2010/11/08/how-to-protect-your-wordpress-blog-from-getting-hacked/" target="_blank">How to Protect Your WordPress Blog From Getting Hacked</a> &#8211; Pretty self explanatory, unlike a lot of WordPress related posts, this isn&#8217;t just a list of plugins that are flavour of the month (although it does suggest some). An excellent read and essential if you have a WP blog.  I will definitely look into actioning some of the points. (via @<a
href="http://twitter.com/#!/designfollow">designfollow</a>).</li><li><a
href="http://www.shoutmeloud.com/5-wordpress-security-plugin-check-hacked-wordpress-blog.html" target="_blank">5 WordPress Security Plugins To Check Hacked WordPress Blog</a> &#8211; Along the same lines as the first post (although obviously just a list of 5 plugins to checkout) but it covers more about what to do if your server is compromised as opposed to stopping it from getting compromised.  Again, something I should really look at. (via @<a
href="http://twitter.com/#!/UCTweets">UCTweets</a>).</li><li><a
href="http://speckyboy.com/2010/11/08/40-essential-css-templates-resources-and-downloads/">40 Essential CSS Templates, Resources and Downloads</a> &#8211; Not much to say about this, the title really sums it up, a fair bit of filler in the list but also some gems including a nice rule generator that will work as a shiv for IE when playing with CSS3 (via @<a
href="http://twitter.com/#!/designfollow">designfollow</a>)</li><li><a
href="http://addyosmani.com/blog/essentialjsdesignpatterns/" target="_blank">Essential JavaScript and jQuery design patterns</a> &#8211; This is an article about a free ebook that I have just downloaded and skimmed through, at first glance it looks amazingly useful.  It explains many of the core design patterns and when to use them.  It also comes with printable materials. (via @<a
href="http://twitter.com/#!/elijahmanor">elijahmanor</a>)</li></ul> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2010/11/development/some-pretty-awesome-web-dev-links/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>A post from my iPad</title><link>http://tosbourn.com/2010/05/other/a-post-from-my-ipad/</link> <comments>http://tosbourn.com/2010/05/other/a-post-from-my-ipad/#comments</comments> <pubDate>Sat, 29 May 2010 07:58:27 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Other]]></category> <category><![CDATA[iPad]]></category> <category><![CDATA[Wordpress]]></category><guid
isPermaLink="false">http://www.tosbourn.com/2010/05/nothing-of-consequence/a-post-from-my-ipad/</guid> <description><![CDATA[Just testing the iPad app for WordPress, looks pretty slick and responds well. Typing I have found to be a little sensitive but I am sure I will get used to it in time! If anyone wants to suggest apps I should be checking out please leave a comment below.]]></description> <content:encoded><![CDATA[<p>Just testing the iPad app for WordPress, looks pretty slick and responds well.</p><p>Typing I have found to be a little sensitive but I am sure I will get used to it in time!</p><p>If anyone wants to suggest apps I should be checking out please leave a comment below.</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2010/05/other/a-post-from-my-ipad/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>Adsense Tips and Tricks</title><link>http://tosbourn.com/2009/07/web-stuff/adsense-tips-and-tricks/</link> <comments>http://tosbourn.com/2009/07/web-stuff/adsense-tips-and-tricks/#comments</comments> <pubDate>Fri, 10 Jul 2009 15:00:37 +0000</pubDate> <dc:creator>Toby</dc:creator> <category><![CDATA[Web Stuff]]></category> <category><![CDATA[Adsense]]></category> <category><![CDATA[Money]]></category> <category><![CDATA[Smashing Magazine]]></category> <category><![CDATA[Wordpress]]></category><guid
isPermaLink="false">http://www.tosbourn.com/?p=97</guid> <description><![CDATA[Damn that Smashing Magazine!  One of the topics I had written down to talk about on this blog ages ago was some Adsense tips and tricks. There have been some excellent posts in the past about how to best use Adsense, however as they were &#8216;in the past&#8217; a few of them seemed a little [...]]]></description> <content:encoded><![CDATA[<p>Damn that Smashing Magazine!  One of the topics I had written down to talk about on this blog ages ago was some Adsense tips and tricks.</p><p>There have been some excellent posts in the past about how to best use Adsense, however as they were &#8216;in the past&#8217; a few of them seemed a little dated.  And now that Adsense has fallen out of favour with a lot of web people there doesn&#8217;t seem to be the same type of stuff being written about it as there used to be.</p><p>So my plan was to chat a little about my experiences with Adsense, and provide whatever hints I have picked up a long my path of web development in a nice and simple blog post.</p><p>That plan went out the window when I read <a
href="http://www.smashingmagazine.com/2009/07/08/perform-better-with-google-adsense-the-ultimate-round-up/">this article</a> by SM, as they say, it is the &#8216;ultimate roundup&#8217; and it really covers everything I was going to cover!  There is no point in me reinventing the wheel so I say give that article a good read, but come back here to discuss it! (just kidding!).</p><p>The only thing I would add is to mention the WordPress plugin that I use to host ads on this site &#8211; it is <a
href="http://wordpress.org/extend/plugins/all-in-one-adsense-and-ypn/">all-in-one-adsense-and-ypn</a> and it works a charm!</p> ]]></content:encoded> <wfw:commentRss>http://tosbourn.com/2009/07/web-stuff/adsense-tips-and-tricks/feed/</wfw:commentRss> <slash:comments>2</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> </channel> </rss>
<!-- Served from: tosbourn.com @ 2012-02-07 05:35:10 by W3 Total Cache -->
