<?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>More than a maths teacher &#187; Wordpress</title>
	<atom:link href="http://www.morethanmaths.com/teacher/category/3-teacherhacker/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.morethanmaths.com/teacher</link>
	<description>My adventures in maths teaching</description>
	<lastBuildDate>Fri, 10 Feb 2012 23:10:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>In The (Learning) Zone</title>
		<link>http://www.morethanmaths.com/teacher/2011/04/22/in-the-learning-zone/</link>
		<comments>http://www.morethanmaths.com/teacher/2011/04/22/in-the-learning-zone/#comments</comments>
		<pubDate>Fri, 22 Apr 2011 16:28:55 +0000</pubDate>
		<dc:creator>Lois Lindemann</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.morethanmaths.com/teacher/?p=653</guid>
		<description><![CDATA[<p>I’ve been doing some more work on MoreThanMaths.com over the last couple of days. It was high time that I added some content to the Learning Zone. In the process of doing this I learned something. How appropriate.</p> <p>Anyway, having spent a bit of time grappling with the wonders of combing Flash and WordPress, [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve been doing some more work on MoreThanMaths.com over the last couple of days. It was high time that I added some content to the Learning Zone. In the process of doing this I learned something. How appropriate.</p>
<p>Anyway, having spent a bit of time grappling with the wonders of combing Flash and WordPress, I thought I’d share what I’ve discovered:</p>
<h4>1. Embedding Flash files in a WordPress site</h4>
<p>I’ve been doing this for a while (<a href="http://www.morethanmaths.com/fun/puzzles/squarecoins/">here&rsquo;s an example</a>) and I’ve found the easiest way is to use a good plugin. </p>
<p>I recommend <a href="http://wordpress.org/extend/plugins/swfobj/">SwfObj</a> &#8211; it’s reliable and really easy to use. I usually add some code to my posts/pages, eg:</p>
<blockquote><div class="code">&#91;swfobj src=&quot;http://www.morethanmaths.com/mtm-content/puzzles/coins-01-triangle-to-square.swf&quot; height=&quot;450&quot; width=&quot;600&quot;]</div>
</blockquote>
<p>Alternatively, I can use the link that the plugin adds to the WordPress dashboard. When writing a post or page, just look for an icon with a little <em>f</em>. It’s sitting next to the other media upload icons. Click it and follow the instructions. It’s easy!</p>
<p>  <center> <img src="http://www.morethanmaths.com/teacher/wp-content/uploads/2011/04/SwfObj-on-dashboard.gif" width="600" height="178" /> </center>
<p>There are two functions from the SwfObj plugin that I don’t use. </p>
<p><strong>- Alignment</strong></p>
<p>I find it easier to align the movie by placing the code inside center tags:</p>
<blockquote><div class="code">&lt;center&gt;      <br />&#91;swfobj src=&quot;http://www.morethanmaths.com/mtm-content/puzzles/coins-01-triangle-to-square.swf&quot; height=&quot;450&quot; width=&quot;600&quot;]      <br />&lt;/center&gt;</div>
</blockquote>
<p><strong>- Full screen view</strong></p>
<p>I offer a hyperlink to a full screen version of the file rather than using the built in function (<a href="http://www.morethanmaths.com/learn/measureisland/">example on this page</a>). This makes it easier for anyone who wants to grab a copy of the movie (eg to embed in a flipchart file for an interactive whiteboard), or who wants to hyperlink straight to it.</p>
<p>Incidentally, if you are going to do this, make sure that your Flash movies don’t have things going on offstage – otherwise they will show up! Many of my movies do have things going on offstage, but before publishing I cover these with a ‘curtain’ – actually a big white rectangle with a hole that shows the stage. Yes, I could deal with this by setting opacity on a webpage, but that won’t help if someone downloads the individual file.</p>
<h4>2. Linking one Flash movie to another</h4>
<p>Some of my resources aren’t single Flash files, they are too big for that. For example, <a href="http://www.morethanmaths.com/learn/measureisland/">Measure Island</a> is made from a set of Flash files: one for the introduction, one for the map, one for the flea circus activity etc. They are linked together using Actionscript commands within the Flash files. This command is used to load the flea circus:</p>
<blockquote><div class="code">_root.loadMovie(&quot;ruler_flea_circus.swf&quot;);</div>
</blockquote>
<p>After trying to get this to work with WordPress, I learned that this doesn’t work quite as I expected. I knew that the <code>loadmovie</code> command was a relative link. I was surprised to learn that it doesn’t point at the folder/directory that contains the Flash movie; instead it defaults to the folder/directory that holds the webpage that the movie is on. </p>
<p>My old site consisted of static html pages, with the relevant Flash files held in the same folders, so that wasn’t a problem. On my WordPress site, it was an issue, because the ‘folder’ containing the page doesn’t exist as such on a database driven site.</p>
<p>I tried lots of things before realising that the solution was easy! </p>
<p>I tried putting an absolute link in my <code>loadmovie</code> commands. The result was crashing Flasherama. Not pretty. Not recommended. </p>
<p>I discovered the base command on Adobe’s page listing <a href="http://kb2.adobe.com/cps/127/tn_12701.html">Flash OBJECT and EMBED tag attributes</a></p>
<blockquote><p><code>base</code> -. or <em>[base directory]</em> or <em>[URL]</em>. Specifies the base directory or URL used to resolve all relative path statements in the Flash Player movie. This attribute is helpful when your Flash Player movies are kept in a different directory from your other files.</p>
</blockquote>
<p>I failed at using this in various ways before eventually deciding to try a base command with SwfObj. There is no mention that this is supported on the <a href="http://orangesplotch.com/blog/swfobj/">plugin’s page</a>, but the plugin does use the SWF Object 2.2 library and I was getting desperate&#8230;</p>
<blockquote><div class="code">&#91;swfobj src=&quot;http://www.morethanmaths.com/mtm-content/measureisland/mi_intro.swf&quot;&lt;/a&gt; height=&quot;450&quot; width=&quot;600&quot; base=&quot;http://www.morethanmaths.com/mtm-content/measureisland/&quot; &#93;</div>
</blockquote>
<p>It worked perfectly! Now when a user clicks on a link in my Flash movie, it looks in my <code>www.morethanmaths.com/mtm-content/measureisland/</code> folder for the Flash file. No crashing, no gnashing of teeth. You can <a href="http://www.morethanmaths.com/learn/measureisland/">see the results here</a>.</p>
<p>As I said, I recommend <a href="http://wordpress.org/extend/plugins/swfobj/">SwfObj</a> &#8211; it’s reliable and really easy to use. And it does even more than it says on the tin!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morethanmaths.com/teacher/2011/04/22/in-the-learning-zone/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Rollover Images</title>
		<link>http://www.morethanmaths.com/teacher/2009/12/28/using-rollover-imags/</link>
		<comments>http://www.morethanmaths.com/teacher/2009/12/28/using-rollover-imags/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 09:00:47 +0000</pubDate>
		<dc:creator>Lois Lindemann</dc:creator>
				<category><![CDATA[1. Learning and Teaching]]></category>
		<category><![CDATA[3. Teacherhacker]]></category>
		<category><![CDATA[e-learning]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[rollover]]></category>

		<guid isPermaLink="false">http://www.morethanmaths.com/teacher/?p=418</guid>
		<description><![CDATA[<p>Yesterday I wrote about creating rollover images in WordPress. This is all very nice, but what&#8217;s the point?</p> 1. Engagement <p>Last term I sat with some students and asked them to show me things that they liked on various websites. There was no agreement whatsoever about preferred colour schemes, design styles or layouts, but [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I wrote about <a href="http://www.morethanmaths.com/teacher/2009/12/27/creating-rollover-images-in-wordpress/">creating rollover images in WordPress</a>. This is all very nice, but what&#8217;s the point?</p>
<h4>1. Engagement</h4>
<p>Last term I sat with some students and asked them to show me things that they liked on various websites. There was no agreement whatsoever about preferred colour schemes, design styles or layouts, but almost everyone liked games, videos and interactive content. I am reliably informed that buttons which change when the mouse is rolled over them are &#8216;cool&#8217;.</p>
<p>If a set of buttons with rollover effects will encourage students to access the site I&#8217;ve set up for them, then it&#8217;s worth doing. (Yes I know, it&#8217;ll take much more than that, but it&#8217;s still worth it.)</p>
<h4>2. Simple interactive content</h4>
<p>Once you&#8217;veset up the use of rollover effects for the first time, it makes it possible to put some simple interactive content into web pages or posts in a class blog. Here&#8217;s a few examples:</p>
<p><strong>Flashcards:</strong></p>
<div id="hoverlink">
<div align="center"><a><img style="margin: 0px 10px 10px 0px;" src="http://www.morethanmaths.com/teacher/sample-files/2009/12/cat.gif" border="0" alt="cat" width="250" height="120" /></a><a><img style="margin: 0px 10px 10px 0px;" src="http://www.morethanmaths.com/teacher/sample-files/2009/12/cow.gif" border="0" alt="cow" width="250" height="120" /></a></div>
</div>
<p>I&#8217;m going to ask Y10 to make some of these for the perimeter/area/volume formulae that they need to learn for their exam in January.</p>
<p><strong>Revision prompts:</strong></p>
<div align="center">Can you name the sides in this triangle?<br />
(Roll your mouse over the image to see the answer.)</div>
<div id="hoverlink">
<div align="center"><a><img style="margin: 0px 10px 10px 0px;" src="http://www.morethanmaths.com/teacher/sample-files/2009/12/triangle.gif" border="0" alt="Triangle" width="300" height="200" /></a></div>
</div>
<p><strong>Giving information or clues:</strong></p>
<div align="center">In a flowerpot in my garden I found 3 slugs, 2 spiders and 4 beetles.<br />
How many legs were there altogether in the flowerpot?</div>
<div id="hoverlink">
<div align="center">
<table id="AutoNumber2" style="border-collapse: collapse" border="0" cellspacing="0" cellpadding="0" width="27%" bordercolor="#111111">
<tbody>
<tr>
<td width="20%"><a><img src="http://old.morethanmaths.com/egg/Images/spider.gif" border="0" alt="Spider" width="72" height="79" /></a></td>
<td width="45%"><img src="http://old.morethanmaths.com/egg/Images/flowerpot.gif" border="0" alt="Flowerpot" width="188" height="161" /></td>
</tr>
<tr>
<td width="20%"></td>
<td width="45%">
<p align="right"><a><img src="http://old.morethanmaths.com/egg/Images/slug.gif" border="0" alt="Slug" width="116" height="50" /></a></p>
</td>
</tr>
<tr>
<td width="20%"></td>
<td width="45%"><a><img src="http://old.morethanmaths.com/egg/Images/beetle2.gif" border="0" alt="Beetle" width="66" height="53" /></a></td>
</tr>
</tbody>
</table>
</div>
</div>
<p>Any more suggestions?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.morethanmaths.com/teacher/2009/12/28/using-rollover-imags/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Rollover Images in WordPress</title>
		<link>http://www.morethanmaths.com/teacher/2009/12/27/creating-rollover-images-in-wordpress/</link>
		<comments>http://www.morethanmaths.com/teacher/2009/12/27/creating-rollover-images-in-wordpress/#comments</comments>
		<pubDate>Sun, 27 Dec 2009 11:04:55 +0000</pubDate>
		<dc:creator>Lois Lindemann</dc:creator>
				<category><![CDATA[3. Teacherhacker]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[rollover]]></category>

		<guid isPermaLink="false">http://www.morethanmaths.com/teacher/?p=355</guid>
		<description><![CDATA[<p>My student website is long overdue for a major revamp. I decided to rebuild the site using WordPress, which is going well, but some of the things I want to do are not automatically built in, so I thought I&#8217;d try to write some very simple guides as I work out how to do [...]]]></description>
			<content:encoded><![CDATA[<p>My student website is long overdue for a major revamp. I decided to rebuild the site using WordPress, which is going well, but some of the things I want to do are not automatically built in, so I thought I&#8217;d try to write some <em>very</em> simple guides as I work out how to do things.</p>
<p>My students all seem to like rollover images, so I wanted to incorporate them. Here&#8217;s how I did it:</p>
<h4>You will need:</h4>
<p>- A self-hosted WordPress blog. This simply will not work for a blog that is hosted on <a href="http://wordpress.com/" target="_blank">WordPress.com</a>, because this process requires Javascript, which is <a href="http://en.support.wordpress.com/code/" target="_blank">not allowed on WordPress.com blogs</a>. (That&#8217;s one of the many reasons I opted to go for the self-hosted option.)<br />
- A folder somewhere on the web to hold your images.<br />
- A text editor, such as Notepad.</p>
<h4>Step One &#8211; Create some images</h4>
<p>You will need two images &#8211; the basic image that will appear at first and the image that will replace it when the user hovers their mouse over. Obviously these images should be the same size! I created <code>gifs</code>, but <code>pngs</code> will also work. You will need to stick to one format, don&#8217;t use a mixture of file types.</p>
<p>Your rollover image needs to have the same name as the basic image, but with an ending such as <code>_over</code> added at the end: e.g. <code>my-image.gif</code> and <code>my-image_over.gif</code></p>
<p>Once you have finished, upload your images to the web. You must save the two images in the same folder.</p>
<h4>Step Two &#8211; Create and upload a Javascript file</h4>
<p>Actually, no knowledge of Javascript is required here, because <a href="http://www.atlantajones.com/2007/09/27/easy-reusable-image-rollovers-with-jquery/" target="_blank">Atlanta Jones has created and shared a tutorial and a script that works perfectly</a>. If you have created <code>gif</code> files and used the <code>_over</code> ending on your file names, you can simply download and use this file: <a href="http://www.morethanmaths.com/teacher/sample-files/2009/12/rollover.js">rollover.js</a>. Alternatively you can copy and paste this script into a text editor (<strong>NOT</strong> MS Word &#8211; I used notepad) and save it as <code>rollover.js</code>:</p>
<blockquote>
<div class="code">
<pre>jQuery(function($) {
$(document).ready(function() {

		// Preload all rollovers
		$("#hoverlink img").each(function() {
			// Set the original src
			rollsrc = $(this).attr("src");
			rollON = rollsrc.replace(/.gif$/ig,"_over.gif");
			$("&lt;img&gt;").attr("src", rollON);
		});

		// Navigation rollovers
		$("#hoverlink a").mouseover(function(){
			imgsrc = $(this).children("img").attr("src");
			matches = imgsrc.match(/_over/);

			// don't do the rollover if state is already ON
			if (!matches) {
			imgsrcON = imgsrc.replace(/.gif$/ig,"_over.gif"); // strip off extension
			$(this).children("img").attr("src", imgsrcON);
			}

		});
		$("#hoverlink a").mouseout(function(){
			$(this).children("img").attr("src", imgsrc);
		});

	});
});</pre>
</div>
</blockquote>
<p>If you have changed filetypes or endings, you will need to edit the script with your text editor to change anything that says <code>.gif</code> to <code>.png</code>, or anything that says <code>_over</code> to match the ending you used on your file names.</p>
<p>The script tells WordPress to pre-load your rollover images and what to do when the mouse is rolled over and off. It is dependent on a tag called <code>hoverlink</code> (I made that name up, you can change it if you want). We&#8217;ll use this tag in step four.</p>
<p>Once you have your Javascript file, you need to upload it. It needs to go in the root folder for the theme that you are using in Wordress. You will end up with a file at <code>/wp-content/themes/whateveryourthemeiscalled/rollover.js</code></p>
<h4>Step Three &#8211; tell WordPress to use the file that you just created</h4>
<p>The good news is that WordPress comes bundled with JQuery, so all you have to do is tell it to use it. Even beter, <a href="http://www.frodesigns.com/2009/07/jquery-in-wordpress/" target="_blank">Brian at frodesigns.com has kindly shared the code</a> that is needed.</p>
<p>You will need to edit your <code>header.php</code> file, find this by clicking on <code>Appearance</code>, then <code>Editor</code>. First find the <code>&lt;head&gt;</code> tag. <strong>NB</strong> in some themes the the <code>&lt;head&gt;</code> tag may not look exactly like that, so you may need to look for something like this: <code>&lt;head with-some-extra-code-here&gt;</code>.<br />
Once you&#8217;ve found the <code>&lt;head&gt;</code> tag, copy and paste this code directly under it:</p>
<blockquote>
<div class="code">
<pre>    &lt;?php
       wp_enqueue_script('jquery');
       wp_enqueue_script('jquery-core-ui');
       wp_enqueue_script('jquery-tabs-ui');
       wp_enqueue_script('hoverlink', get_bloginfo('template_directory').'/rollover.js');
       wp_head();
    ?&gt;</pre>
</div>
</blockquote>
<p>You can see the penultimate line directs WordPress to the jQuery code for the image rollover effect that we are creating. It also refers to the <code>hoverlink</code> tag that we&#8217;ll use in the next step.</p>
<h4>Step Four &#8211; putting your images into a post or page</h4>
<p>Now you can actually put your images into a post or page. The last bit of technical trickery is to put your images inside a section tagged <code>"hoverlink"</code>. To do this, use the html editor to create your page or post, rather than the visual editor.</p>
<p>This is the code that I used to create the image at the end of this post:</p>
<blockquote><p><code><br />
<span style="color: #666666;">&lt;div id="hoverlink"&gt;<br />
&lt;a href="<span style="color: #0000ff;">http://www.morethanmaths.com/teacher</span><span style="color: #666666;">"&gt;&lt;img src="</span><span style="color: #0000ff;">http://www.morethanmaths.com/teacher/sample-files/2009/12/my-avatar.gif</span><span style="color: #666666;">" border="0" alt="<span style="color: #0000ff;">My Avatar</span><span style="color: #666666;">" width="</span><span style="color: #0000ff;">220</span><span style="color: #666666;">" height="</span><span style="color: #0000ff;">220</span><span style="color: #666666;">" /&gt;&lt;/a&gt;&lt;/div&gt;</span><br />
</span></span></code></p></blockquote>
<p>You can see that the code relating to the image is contained inside two tags: <code>&lt;div id="hoverlink"&gt;</code> and <code>&lt;/div&gt;</code>. Obviously you will need to change the highlighted sections to match your own choice of hyperlink, image location and size.</p>
<p>Want a rollover image that isn&#8217;t hyperlinked? No problem:</p>
<blockquote><p><code><br />
<span style="color: #666666;">&lt;div id="hoverlink"&gt;<br />
&lt;a&gt;&lt;img src="</span><span style="color: #0000ff;">http://www.morethanmaths.com/teacher/sample-files/2009/12/my-avatar.gif</span><span style="color: #666666;">" border="0" alt="<span style="color: #0000ff;">My Avatar</span><span style="color: #666666;">" width="</span><span style="color: #0000ff;">220</span><span style="color: #666666;">" height="</span><span style="color: #0000ff;">220</span><span style="color: #666666;">" /&gt;&lt;/a&gt;&lt;/div&gt;</span><br />
</span></code></p></blockquote>
<p>Want your rollover image in a sidebar? Add a text widget and put the code into that. WordPress will recognise the code and display the image with the rollover effect enabled.</p>
<h4>Here&#8217;s the finished product:</h4>
<div id="hoverlink"><a href="http://www.morethanmaths.com/teacher"><img src="http://www.morethanmaths.com/teacher/sample-files/2009/12/my-avatar.gif" border="0" alt="My Avatar" width="220" height="220" /></a></div>
<p>There&#8217;s also an example of a rollover image in the sidebar of this blog, try rolling your mouse over the juggler to see it action &#8211; it&#8217;s a fairly subtle effect this time.</p>
<p>I&#8217;m not a Javascript expert &#8211; in fact I know next to nothing &#8211; but I got this working with little more than copy and paste. I&#8217;ve tried this with WordPress 3.0, 2.9 and 2.8.6, using the Atahualpa and the Default themes. I tested the finished product in Firefox, Chrome and Internet Explorer. As far as I can tell, it&#8217;s working perfectly.</p>
<p>&nbsp;</p>
<p><strong>Update:</strong> <a href="http://www.morethanmaths.com/teacher/2009/12/27/creating-rollover-images-in-wordpress/comment-page-1/#comment-9900">Drew left a really useful comment</a> explaining how to get this to work if you are using a child theme:</p>
<p>&#8220;I was having a problem getting the rollovers to work. The problem was I am using a theme that is a CHILD theme of another (Graph Paper Press): the Parent theme (Modularity) is installed first and the Child theme (On Assignment) is then installed and activated. The .JS file needs to be uploaded to the PARENT theme (Modularity); it does not work if only uploaded to the in-use child theme.&#8221;</p>
<p>&nbsp;</p>
<p><strong>Update 2:</strong> I&#8217;ve done several theme upgrades without problems, but after a recent upgrade on one of my sites I found that I had to do some repair work. If the rollover effects stop working, it&#8217;s worth checking that the <code>rollover.js</code> script is still there and the code after the <code>&lt;head></code> tag is still there. Mine got deleted <img src='http://www.morethanmaths.com/teacher/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>&nbsp;</p>
<p><strong>Update 3:</strong> John left a comment about getting this to work with tables and has shared his code. Thanks John! </p>
<p><code>&lt;div id="hoverlink"><br />
&lt;table><br />
	&lt;tr><br />
		&lt;td>&lt;a href="">&lt;img src="MY IMG URL" border="0" alt="My Avatar" width="150" height="220" />&lt;/a>&lt;/td><br />
		&lt;td>&lt;a href="">&lt;img src="MY IMG URL" border="0" alt="My Avatar" width="150" height="220" />&lt;/a>&lt;/td><br />
		&lt;td>&lt;a href="">&lt;img src="MY IMG URL" border="0" alt="My Avatar" width="150" height="220" />&lt;/a>&lt;/td><br />
	&lt;/tr><br />
	&lt;tr><br />
		&lt;td>&lt;a href="">&lt;img src="MY IMG URL" border="0" alt="My Avatar" width="150" height="220" />&lt;/a>&lt;/td><br />
		&lt;td>&lt;a href="">&lt;img src="MY IMG URL" border="0" alt="My Avatar" width="150" height="220" />&lt;/a>&lt;/td><br />
		&lt;td>&lt;a href="">&lt;img src="MY IMG URL" border="0" alt="My Avatar" width="150" height="220" />&lt;/a>&lt;/td><br />
	&lt;/tr><br />
&lt;/table><br />
&lt;/div></code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.morethanmaths.com/teacher/2009/12/27/creating-rollover-images-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>37</slash:comments>
		</item>
	</channel>
</rss>

