Tag Archives: wordpress

New WordPress Plugin: Story Latest

I wanted a way to easily present a “latest articles on this story” list on Lichfield Live articles so I developed this simple plugin which uses a shortcode and tags to achieve that.

For example, the Friary Outer development is an ongoing story that we’re covering. All of the related articles are tagged with “Friary Outer” and can be seen here: http://lichfieldlive.co.uk/tag/friary-outer/

Clicking on any one of them you will see a list at the bottom of the article of all the articles related to that story, with the most recent at the top.

This is achieved by adding the following shortcode to each post:

[story-latest tag=”friary-outer”]

The plugin replaces that with the list of posts. Great for any site that has multiple posts on the same topic and wants to group them easily.

Download now from WordPress.org. Feedback welcome in the comments or at WordPress.org.

Hiding bbPress topics from logged out users

I just spent hours figuring this out so I thought I’d try and save others the bother by sharing it here.

The basic aim was to hide the contents of topics in a bbPress 2.0 forum from any users not logged in. This makes for a nice private forum.

I found suggestions about making forums hidden, private and so on but none of them really worked as they hid them for logged in users too.

My final solution was to make bbPress ‘dumb’ when it comes to logged out users. I.e., it could either be clever and say “there are topics, but you’re not allowed to see them until you login” or it could just say “there are no topics”.

The following code does the latter, dumb version by hooking into the forums, topics and replies loops.

function pj_hla_logged_in_topics($have_posts){
if (!is_user_logged_in()){
$have_posts = null;
}
return $have_posts;
}
add_filter('bbp_has_topics', 'pj_hla_logged_in_topics');
add_filter('bbp_has_forums', 'pj_hla_logged_in_topics');
add_filter('bbp_has_replies', 'pj_hla_logged_in_topics');

I simply placed this within my theme’s functions.php but you could just as easily wrap this in a plugin.

The Walled Garden

Thanks to my involvement in Lichfield Live I discovered earlier this year a project based out of Woodhouse Community Farm in Fisherwick, near Whittington.

The Walled Garden is a community-supported agriculture project set mostly within the listed walls that once stood part of the Fisherwick Hall Estate. Jess and I joined in July and for our £38.80 per month we get a box full of vegetables every week which I collect on my bike.

It’s a great project where we chip in as well and there are some exciting developments ahead. I also wanted to help by offering my skills as a WordPress developer and so I built a web site for new and existing members.

The aim was to create a site which informed potential new members about the project, allowed them to sign up online whilst also distributing updates to current members which would be available online for anyone interested to see.

Here’s how I did it;

  • Starting with a simple WordPress site I modified a newsletter to create the welcome page which outlined what The Walled Garden is all about and why it’s such a great idea!
  • I’d already created a video tour of the place for Lichfield Live, which I embedded on another page for all to see.
  • Then, using the most excellent Gravity Forms plugin (a must have plugin) I built a sign up form. Using pricing fields it automatically calculates the price to pay based on the size of box you want and the membership fee.
  • When submitted the form does a number of things. It;
    • sends Annamarie at Woodhouse an e-mail with the details of the new member
    • creates a new WordPress user account for the member for future use
  • Adding a user account was also crucial for the next step; sending out updates by e-mail. This is my favourite bit! Instead of sending out e-mails to all the members each week, Annamarie now creates a new post in WordPress and once published, the post is automatically e-mailed out to all the members, using the Subscribe by Email plugin. Now anyone visiting the site can even see what they’ll be getting each week!
  • Lastly, I wanted to make sure that the whole system wasn’t overcomplicated for Annamarie. WordPress can be quite daunting, especially if all you need to do is add a new post. So I’ve used the excellent Easy Blogging plugin to present a really simple, streamlined interface.

I’ve taken screenshots of the site, including that simple dashboard, which you can check out below.

WordPress Author Bio Shortcode v1.2 plugin released

I finally got round to updating this quick-release Author Bio Shortcode plugin. The main changes are background stuff and making sure it’s compatible with the latest version of WordPress (v3.2.1 as I type).

One important feature is that I’ve locked in compatibility only to v3.2.1 and older. If you’re using a version of WordPress prior to 3.2.1 you won’t be able to activate. Upgrade!

Secondly, while the original version only allowed you to place the bio of the current post’s author (i.e. it would print my bio here because I’m the author of this post), you can now specify an author using one of three methods.

Here’s some examples…

Show the current post author’s bio:

[author_bio]

Display the author bio of the author with user ID #4:

[author_bio id=”4″]

Display the author bio of the author whose username is ‘bobby’:

[author_bio username=”bobby”]

Display the bio of the author whose e-mail address is me@example.com:

[author_bio email=”me@example.com”]

This is really useful for creating a “team” page on your site.

If you have any questions, comments or feedback, leave them here or on the WordPress.org forums.

If you use it and it works, please leave a rating and mark it as working on it’s WordPress.org plugin page!

Add a shortlink to the end of your WordPress posts

Once again, that Andy Mabbett has given me the reason to knock out a quick WordPress plugin.

This one prints out a “Shortlink for this post” link (see screenshot) to the end of all your posts. It uses WordPress’ built in shortlink feature which doesn’t always produce very short URLs so you’ll want to use one of the shortener plugins alongside it.

You should also consider activating this shortlink plugin too which adds machine-readable references to the shortlink in the code for each page.

Download the plugin here and then,

  1. Unzip and upload add-shortlink-to-posts.php to your /wp-content/plugins directory
  2. Login to your dashboard
  3. Go to Plugins and activate the Add Shortlink to Posts plugin
  4. Check it works okay

WARNING: This has not been tested extensively and may well cause a black hole to open up and swallow your dog. Ensure you have a back up before trying out any untested plugins like this one.

If you do get it working, I’d appreciate you letting me know in the comments including what version of WordPress you are using and whether it’s a Multisite or not.

Building a hyperlocal business directory: call for suggestions

I’ve long been planning to build a hyperlocal directory for The Lichfield Blog and something which can be used by other hyperlocals.

B31 Blog launched their business directory the other day using a simple form submission and manual entry of listings. Owner Sas Taylor complained on Twitter about the lack of a decent business directory plugin, something I’m well aware of.

So when I mentioned I have been planning my own I got a few excited responses and figured if there’s interest why not ask those interested what they’d like in a directory.

Let’s start off with fields;

  • Name (of the business, of course!)
  • Address (incl postcode, of course)
  • Phone number
  • Fax number
  • Mobile number
  • E-mail address
  • Opening times
  • Contact name
  • Web site address
  • Description
  • Wheelchair/disabled access?
  • Toilets?
  • Disabled toilet?
  • Photo
  • Location(s) (pinpoint on a map)
  • Twitter
  • Facebook
  • Foursquare

Features

  • Ratings
  • Reviews
  • Maps (using postcode/address)
  • Search, with filters
  • Show directory as;
    • a list,
    • categories,
    • a map.

Options

  • Toggle visibility of fields
  • Payment option (to charge for listings)
  • Paid-for upgrades (e.g. add additional photos/info)
  • Use opening-times.co.uk for opening times so we simultaneously build up that site (which I made a plugin for)
  • Pre- or post-moderate listing submissions

Any others? Add your suggestions to the comments below…

The choice is clear for out-of-work journalists: pay £2,750 or… less than £100

As a freelance WordPress consultant by day I am horrified that a company can justify charging £2,750 for a WordPress site built using a pre-built theme costing £55 .

The example they give on their hideously long sales page is unremarkable at best. Let’s do a quick comparison;

Even employing me as a freelancer, £2,750 would get you not only a WordPress installation bolstered by a bunch of security features to tighten up the out-of-the-box setup, but a completely custom theme designed by a professional web designer and a good chunk of custom development work.

Having taken a look at euvue.co.uk it looks very simple and something I’d probably charge less than £500 for. Having said that, the exact same site could be placed on my Journal Local platform (also built on WordPress) for a small monthly fee which wouldn’t even approach £500 over 12 months.

So what are Super Local Sites charging for?

The sales page mentions training. That would sound good, if it weren’t for a system that, once you get clicking around, is very easy to get used to and even if you struggle there are a wealth of tutorials, including videos, on the web for free.

I still can’t figure out where that £2,750 is going…. maybe into revenue generation tools?

“Unlock your earning potential with the built-in advertising management system, including sliding banner, 4×4 blocks and classified ads with full AdSense compatibility (Google advertising). You could expect to pay thousands for this unique system however we have taken a sensible approach to pricing that won’t break the bank!” (my highlighting)

Let’s just discredit one thing for a start: no one in their right mind will consider Google AdSense to be a credible revenue generation tool for a sustainable web site. I’d love to know what’s unique about the ability to use WordPress’ built-in Text widget to paste Google AdSense code into your sidebar (here’s a free online tutorial showing you how in 9 steps), or even one of the many advertising plugins already available. I wonder which classifieds plugin they’ve installed (that takes less than a minute to do, by the way, thanks to WordPress’ built-in plugin search and installer).

No, I’m still stumped. Once you get past the features that are standard in WordPress anyway Super Local Sites appears to be charging for something that could easily be created in a day without hardly spending a penny.

I actually find it offensive that anyone can charge that amount for something so simple and that’s built mostly on freely available tools and resources. The fact they’re charging £2,750 to out-of-work journalists is even worse – my fear is that many journalists taking the risky plunge into entrepreneurship will get burned by the unnecessarily high overheads and fail in their first year.

WordPress plugin: Show blogroll links in a post or page with ease!

I’ve decided to start blogging when I find or use a really good plugin that I think people should know about, this being the first!

WP Render Blogroll Links allows you to add a simple shortcode to a blog post or page to display a list of links. You can see an example of it in use on Journal Local.

The plugin has a wide range of customisation options including;

  • Show/hide category titles
  • Include/exclude categories
  • Show/hide descriptions
  • Customise order of links
  • Show descriptions alongside, or below, links
  • Add ‘rel’ attributes to links

All of these are detailed in the clear and comprehensive FAQs. You can download the plugin from WordPress.org.

New hyperlocal WordPress plugin: OpeningTimes.co.uk

I received a tweet the other day from the wonderful Andy Mabbett. It read;

http://opening-times.co.uk/ is very #hyperlocal oriented. They’re on Twitter: @opening_times / @willperrin @getgood (widget, @philipjohn ?)

So I toddled over to the Opening Times web site and had a gander, found some XML there and thought to myself,

Hmm that’ll only take five minutes.

It took twenty but I created a very simple widget for WordPress that displays search results for an area you specify. Here’s a screenshot:

A screenshot of the opening times widget
A screenshot of the opening times widget

You can download it now although be aware that it’s in beta so it might throw up errors occasionally. I already know that it doesn’t handle postcodes very well, so be careful with using them.

If you have any thoughts/suggestions/comments/criticisms, add a comment below!