Marty Spellerberg

WordPress 3.0 Network Domain Name Mapping on MediaTemple

June 21st, 2010

Updated June 27.

I’m really excited about the new Network feature in WordPress 3, which allows you to run many sites off the same install. I’m hoping this makes it easier to keep my friends’ sites up-to-date and malware free.

I installed WordPress at 0003.org and am running the second site kateschneider.net off of it. Here’s how:

1. Follow the standard WordPress installation instructions. Give some thought to where you want to put this, as you won’t want to change it later.

2. Follow the codex instructions to Create A Network. You have a choice between subfolders and subdomains; I went with subfolders. Subfolders turned out to be a problem for root-relative links in sites whose domains aren’t yet attached, so I re-started with subdomains.

3. Go ahead and add the second site using Super Admin -> Sites.

4. Next, follow Otto’s Domain Mapping plugin tutorial. I found you don’t need to use the “mu-plugins” folder, It turns out there is a good reason to use the mu-plugins folder and it stands not for “multiuser” but “Must Use”; but IMPORTANTLY, you DO need to use the trunk version rather than the standard version. It looks like they’ve updated the plug-in so now it’s cool.

5. Otto says that when it comes to mapping the domain, all hosts are different. MediaTemple users will want to follow the KB instructions for Pointing Multiple Domains to the Same Alternate Domain Folder. (In their example, “mt-example.com” would be the name of the domain where you’ve installed WordPress, and “alt-example.com” the second site.)

6. Finally, go back Super Admin -> Sites and Edit the second site. Under Site Info there’s a checkbox for “Update siteurl and home as well”; uncheck that. Then scroll down and update the Siteurl and Home fields with the proper domain name.

That’s it — one WordPress, two sites! I hope the instructions make sense; please let me know if they don’t.

Cheers!

jQuery Extract Headings for Tab Controls

June 20th, 2010

Hi there. I posted previously about making jQuery tabs, but this week I found myself wanting take that code a bit further. In the old version, the “controls” were written out in a ul above the slides. It got the job done, but wasn’t ideal from a progressive-enhancement point of view (non-JS don’t really have much need for them, so they really shouldn’t be there for those users).

In this version we’re going to include an h3 at the top of each slide and have jQuery pull those out to make the ul controls. The HTML is like so:

1
2
3
4
5
6
7
8
9
10
<div id="slides">
	<div class="slide">
		<h3>Slide 1</h3>
		<p>This is the content of slide one</p>
	</div>
	<div class="slide">
		<h3>Slide 2</h3>
		<p>This is the content of slide two</p>
	</div>
</div>

And the jQuery (the new action is in the first fifteen lines):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
$(document).ready(function() {
 
	// Insert the wrapper for the controls
	$('#slides').before('<ul id="slidecontrols"></ul>');
 
	//For each heading...
	$('#slides div.slide > h3').each(function(){
		// Copy it into the controls
		$(this).clone().appendTo("#slidecontrols");
		// and replace the heading markup with list markup, keeping the contained text
		$('#slidecontrols h3').replaceWith('<li><a href="#">' + $(this).text() + '</a></li>');
	});
 
	// Hide those H3s
	$('.slide > h3').hide();
 
	//Set the initial state: highlight the first button...
	$('#slidecontrols').find('li:eq(0)').addClass('selected');
 
	//and hide all slides except the first one
	$('#slides').find('> div:eq(0)').nextAll().hide();
 
	//actions that apply on click of any of the buttons
	$('#slidecontrols li').click( function(event) {
 
		//turn off the link so it doesn't try to jump down the page
		event.preventDefault();
 
		//un-highlight the buttons
		$('#slidecontrols li').removeClass();
 
		//hide all the slides
		$('#slides > div').hide();
 
		//highlight the current button
		$(this).addClass('selected');
 
		//get the index of the current button...
		var index = $('#slidecontrols li').index(this);
 
		//and use that index to show the corresponding slide
		$('#slides > div:eq('+index+')').show();
 
	});
 
});

Happy coding!

Half Empty #1 and #2 now online

June 13th, 2010

As I mentioned previously, I’ve been migrating the Half Empty archive into a WordPress implementation. I am happy to announce that all material from the paper magazines Half Empty #1 and Half Empty #2 is now online!

Half Empty #1, published in 2003, includes a roundtable discussion on Art In Retail with views from Jeremy Bailey and Sebastien Agneessens; a fashion story illustrated by Jon Burgerman; interviews with television producer Jen Podemski, typographer Pablo Medina and artists Kinya Hanada and Ilan Katin; plus lots of original art.

Half Empty #2, published in 2004, includes a roundtable discussion on Commissioning Street Art moderated by the Wooster Collective; an interview with Karl Ackerman; a look at First Fridays in Phoenix, AZ; artist statements by Inksurge and Jaime Leblanc; reviews of books Type & Typeography and Charles Wilkin’s Index-A; and much more.

In addition to the HTML posts, PDFs can be downloaded from the Half Empty #1 and Half Empty #2 pages.