Sticky Features for your Blog Network with WordPress MU 2.8: Part 2

Exclusive offer: get 50% off this eBook here
WordPress MU 2.8: Beginner's Guide

WordPress MU 2.8: Beginner's Guide — Save 50%

Build your own blog network with unlimited users and blogs, forums, photo galleries, and more!

$26.99    $13.50
by Lesley Harrison | October 2009 | MySQL Content Management Open Source PHP WordPress

Read Part One of Sticky Features for your Blog Network with WordPress MU 2.8 here.

Community features—gravatars

Gravatars are Globally Recognized Avatars. They allow people to carry the same avatar from site to site without having to register at each site and take the time to upload an image. Gravatars are supported by IntenseDebate by default. If a user has a gravatar and gives the email address that the gravatar is tied to when they make a comments, then the gravatar will be displayed beside that comment. Since version 2.5, WordPress MU has had gravatar support built in. Let's add gravatars to our post pages.

Time for action – gravatars in WordPress MU

  1. Open your theme's index.php file. In our case we are editng the Blue Zinfandel theme.
  2. Find the secton that begins with < div class="contentdate" > .
  3. Remove all markup up to the closing tag and insert the following code:
    <?php 
    $email = $authordata->user_email;
    $hash = md5($email);
    $uri = 'http://www.gravatar.com/avatar/' . $hash . '?d=identicon&r
    =any&size=80';
    $headers = wp_get_http_headers($uri);
    if (!is_array($headers)) :
    echo "<h3>";
    echo the_time('M');
    echo "</h3><h4>";
    echo the_time('j');
    echo "</h4>";Stcky Features for your Blog Network
    [ 142 ]
    elseif (isset($headers["content-disposition"]) ) :
    echo get_avatar( $authordata->user_email, $size = '50') ;
    else :
    echo "<h3>";
    echo the_time('M');
    echo "</h3><h4>";
    echo the_time('j');
    echo "</h4>";
    endif;
    ?>
  4. Save and upload the file.
  5. If you wish to use gravatars on user blogs, you will also need to edit the user's version of the theme file.
  6. Now, if a post author has a gravatar, it will be displayed in the title secton of their posts. If not, the default Date of Post box will appear instead.

What just happened?

We have used the built-in WordPress MU gravatars function to display a member's gravatar in the title section of any posts they make.

As the default No Gravatar Set image is rather boring, our code checks to see if the author in question has a gravatar. If the author does not, or if the Gravatars web site is not accessible for any reason, then we display the normal post date icon instead.

Gravatars provide a way for people to carry their identity from site to site. Showing a recognizable face for your site's authors builds recognition among readers and helps readers and blog authors to build a relationship with each other.

You might be wondering why the output in the previous code is broken into several echo statements. I have chosen that method purely because I find it more readable. You could save yourself some typing if you built an echo statement similar to this one:

echo "<h3>". the_time('M')."</h3>"

Have a go hero – gravatars and themes

The code used to edit the SlayerCafe blog theme was very simplistic. The theme you are using for your site may be structured differently.

In the theme for the SlayerCafe, the calendar icon that shows the date of the latest post is coded into the CSS file. The change I have made to the index.php file does not prevent the calendar icon from being loaded. The gravatar image simply loads over the top of it.

Try reworking the theme file to correct this. One way to do so would be to create a copy of the contentdate class in the styles.css file, which does not load the calendar image. Call the new class contentgravatar and then create different < div > tags to be displayed depending on whether you wish to show the calendar or the gravatar.

Encouraging sign-ups with downloads for members only

If you offer file downloads, restricting some of them to only members is a good way to encourage people to sign up. It is a good idea to offer some file downloads to visitors who are just passing through so that you can build up their trust, as some people are uncomfortable giving out their email address to an unknown web site. Also, some people do not want to take the time to register to download a file, especially if they don't know if it is going to be a worthwhile download.

A good compromise is to offer some files to everyone and other files for members only, or to offer some content on your blog and then a download in a more convenient form.

As an example, some of the Watchers on SlayerCafe could run tutorials about demon identification and slaying techniques. They may offer text and image versions as blog posts, with an MP3 version of the lesson that registered Slayers could download to listen to while they are on patrol. This is likely to have a high conversion rate in terms of registrations; the visiting Slayers will hopefully be impressed by the quality of the information in the tutorials and want to download the audio version.

One useful plugin that restricts downloads to registered users only is the User Only Downloads plugin available at http://wpmudev.org/project/user-only-downloads. This plugin is very easy to use. For some reason the author uploaded the plugin to WPMU Dev as a text file, so you will need to rename it to a .php file before you can use it. Just upload the renamed file to your mu-plugins folder and tell your users that they can restrict file downloads to members only by using the following tag in their posts:

[user_download URL]

Logged in users will see a download link, while everyone else will see a bold message telling them that they need to be logged in to download files.

 

WordPress MU 2.8: Beginner's Guide Build your own blog network with unlimited users and blogs, forums, photo galleries, and more!
Published: October 2009
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:

Welcoming new visitors

Blog networks can be confusing when you first visit them. Why not ease the confusion a little by showing first-time visitors a special welcome message at the top of the page, which explains what the site is about and invites them to get involved in some way?

Time for action – creating a welcome message

  1. Download the What Would Seth Godin Do plugin fromhttp://wordpress.org/extend/plugins/what-would-seth-godin-do/.
  2. Copy the what_would_seth_godin_do.php file to your /wp-content/plugins folder.
  3. Activate the plugin in your admin panel.
  4. Turn on auto-activation using Plugin Commander.
  5. Go to Settings | WWSGD and add a welcome message for new members.
  6. Leave the Repetition setting at the default (first 5 visits).
  7. If you have something you would like to alert regular visitors of, you can use the Message to Return Visitors box.
  8. I recommend testing the plugin with the Location of Message set to Before Post. If you don't like the location of the message, change the setting to use the template tag instead.

    Sticky Features for your Blog Network with WordPress MU 2.8: Part 2

  9. New visitors to your site should see a welcome message like this one:

    Sticky Features for your Blog Network with WordPress MU 2.8: Part 2

What just happened?

The What Would Seth Godin Do plugin uses cookies to distinguish between first-time visitors and regular visitors. You can use this knowledge to offer visitors a different experience depending on how many times they have visited the site.

If a visitor comes to your site via a link on someone else's blog, they may not realize that they are visiting a blog network and may not understand what the site is about. A simple message letting them know the subject of the site and inviting them to create their own blog or subscribe to the site's feed should help to point them in the right direction.

You may not want to show a message to returning visitors all the time, but if you have a promotion or special offer that you'd like to display prominently, then using the What Would Seth Godin Do plugin is a convenient way to do so.

The default Before Post setting did not work well for SlayerCafe, so I edited the index.php and home.php template files to get the welcome message to appear in the right place. For the theme I was using, the following code:

<?php wwsgd_the_message(); ?>

should be placed below the line that says:

<div id="contentmiddle">

If you decide to use template tags to display the welcome message, don't forget to add the tags to all of the themes that you will be allowing your users to select.

Welcome message not showing up?
If you can't see the welcome message, you may need to clear your cookies, or at least delete the cookies for the blog network. Most browsers make it easy for you to find the cookies that belong to a particular site. For example, in Firefox just go to Tools | Options, click on the Privacy tab, and then click Show Cookies..... Use the search box to find the cookie you want to delete, select it, and click Remove Cookie.
See the following screenshots for a clearer idea of what you're looking for.

Sticky Features for your Blog Network with WordPress MU 2.8: Part 2

The Cookies screen allows you to see a list of all the cookies Firefox has stored, and you can find the cookies related to your site by using the search box.

Sticky Features for your Blog Network with WordPress MU 2.8: Part 2

Related posts for visitors from search engines

If visitors arrive on your blog network via a search engine, it's likely that they are looking for some information about a specific topic.

Why not take advantage of that by showing search engine-referred visitors a list of posts related to the keywords they searched for?

One way to achieve this is to use the Search Engine Related Posts plugin available at http://wordpress.org/extend/plugins/search-engine-related-posts/. Just install the plugin as normal and then add the following markup:

<div style="display:none" id="search_content"></div>

to your theme files at the point where you want the list to appear. For most people, this would be after the post display section of their index.php file.

The plugin will check the referrer details of your visitors and only show a list  of related posts to the people who have been referred by a search engine. This increases the chance of those visitors staying around to read more articles, finding what they need, and becoming a  regular reader of your site.

Regular visitors are probably reading your blog to stay up to date with the latest news and don't need to see a list of links to older posts, as it is likely that they have already seen them.

Other ways to engage the community

The above are just a few ways you can engage your visitors. There are many others that you may want to look into. Here are a few for inspiration:

Polls

Allowing your members to create polls is a useful way to get feedback from your members and to add a little interactivity to the site. If your site's authors pick the right questions, the information gathered from the polls can be useful, too.

A good polls plugin is: http://wpmudev.org/project/powpoll-for-wpmu-27.

This is one of the easier plugins to get working with WordPress MU. Many of the standard WordPress poll plugins require several steps to activate them on each member's blog,  but PoWPoll can be set to automatically activate on new blogs.

The plugin supports voting restrictions, such as one vote per IP address, and restricts vote casting to logged-in visitors.

Sitewide searching

Making it easy for your visitors to find the content they are looking for is an important part of making a sticky site. With a niche blogging network, it is likely that  someone who is interested in the posts of one member will also be interested in the posts of  others. They may want to search for posts on a specific topic contained anywhere within the network.

There are a number of ways you could implement a sitewide search feature. There are some plugins, such as One Search (http://jason.ungos.com/projects/one-search-wpmu-plugin/), that tie in to WordPress MU to allow sitewide searching, or you could use Google's Site Search.

One Search requires that the user who is accessing the WordPress MU database has  the rights to create VIEWS. At the time of writing, the code available on the plugin  author's web site will also need to be tweaked to work with WordPress MU versions 2.7.1  and  above.

It is possible to integrate Google Custom Search Engine so that the results page  fits with your template. You can learn more at http://www.google.com/coop/cse/.

Summary

This article covered ways to make your site sticky so that when you attract new visitors, they stay around and become part of the community.

We learned about using contact forms to make it easy for our visitors to contact us, and adding a more personal feel to blog posts through the use of gravatars. We also learned about comments and how to make the discussion that takes place in the comments sections of our blogs easier to follow through rating, threaded discussions, and subscription options.

We discussed the value of related posts links to help our visitors find posts that may interest them, and we talked about using polls and searches to draw users in to the site encouraging them to explore everything the site has to offer and making them feel like a part of the community. We also discussed some other ways to improve the experience for both new and regular visitors, including displaying different messages to new visitors to help them "find their feet" on the site.

So far, we've looked at ways to encourage readers to engage with the authors who own blogs on our site. This is a good way to build regular readers. Many people enjoy joining in with discussions on the Internet, but do not want to run their own blog—perhaps because they don't have the time to commit to writing on a regular basis. Such people may still want to discuss issues relating to our site's niche in more depth. That way, bigger discussions can take place in one central location instead of being spread out across various blog comment sections.

WordPress MU 2.8: Beginner's Guide Build your own blog network with unlimited users and blogs, forums, photo galleries, and more!
Published: October 2009
eBook Price: $26.99
Book Price: $44.99
See more
Select your format and quantity:

If you have read this article you may be interested to view :

About the Author :


Lesley Harrison has more than ten years of experience working in the world of IT. She has served as a web developer for various local organizations, a systems administrator for a multinational IT outsourcing company, and later a database administrator for a British utility company. Today, Lesley runs her own video gaming site, Myth-Games.com, and works as a freelance web developer. She works with clients all over the world to develop Joomla! and WordPress/WordPress MU web sites.

Books From Packt

WordPress 2.7 Complete
WordPress 2.7 Complete

jQuery 1.3 with PHP
jQuery 1.3 with PHP

JBoss RichFaces 3.3
JBoss RichFaces 3.3

Plone 3.0 for Education
Plone 3.0 for Education

WordPress 2.7 Cookbook
WordPress 2.7 Cookbook

Joomla! with Flash
Joomla! with Flash

Ext JS 3.0 Cookbook
Ext JS 3.0 Cookbook

WordPress Plugin Development: Beginner's Guide
WordPress Plugin Development: Beginner's Guide

 

 

 

No votes yet

Post new comment

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
s
d
e
v
j
L
Enter the code without spaces and pay attention to upper/lower case.
Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software