Phil Wylie

WordPress developer, Code Club volunteer & Staffs Web Meetup organiser

Building a store listing page in WordPress

This is a post written for the iWeb Control blog in response to Corbin’s request for additional documentation on how to go about displaying map data on the front end when using my map CMB field plugin. The post aims to provide a working example covering a number of WordPress techniques from the basics of registering a post type and associated meta box, to writing a custom template file to output store locations on a map using Google’s Maps API.

Today I’m going to use a number of WordPress techniques to demonstrate the process of building a content managed store listing page. I’ll take you through registering a post type, creating a metabox to save each store’s location and phone…

Building a store listing page in WordPress

Get an excerpt from a specific post ID or post object with a variable excerpt length

I wrote a super small post over on the iWeb Control blog to share a WordPress snippet originally written by Pippin Williamson.

It’s a neat function iweb_get_excerpt_by_id() which returns an excerpt of a posts content. It has a number of parameters which give it a little more power over the default WordPress excerpt function. It’s possible to specify the excerpt length and also which HTML tags are allowed, so you could choose to include some formatting.

Another useful WordPress snippet from Pippin. Pass iweb_get_excerpt_by_id() a post ID or a post object to retrieve an excerpt. The function’s second parameter allows you to specify the length of the excerpt in number of words.

Add a logout link shortcode to WordPress

This is a post written for the iWeb Control blog. A super quick snippet useful for membership sites.

Membership plugins such as s2Member and ecommerce plugins like WooCommerce utilise the built-in WordPress user authentication system. If you run a WordPress site which allows users to login, you may wish to include a logout link within your page content…

Add a logout link shortcode to WordPress

Add Mixcloud oEmbed support to WordPress

This is a post written for the iWeb Control blog. The original post was included in a Trac ticket to support the inclusion of Mixcloud in WordPress Core and it looks likely that WordPress 4.0 will indeed introduce native oEmbed support for Mixcloud.

WordPress comes with a built-in whitelist of oEmbed providers. oEmbed allows us to easily embed content from various providers without worrying about ever-changing embed code.
Mixcloud is not currently in the list of supported providers. Mixcloud suggest installing the Enable oEmbed Discovery plugin which allows editors…

Add Mixcloud oEmbed support to WordPress

Spotify – a free, legal music service

Spotify

Spotify recently removed the invite requirement for its free service in the UK:

“starting today people in the UK will no longer need an invitation to join Spotify, you can register for our free service directly from our website as always our premium, ad-free service is still available”

Having used Spotify for a few weeks now, I’m convinced this is the future of music! The player lets you search through an ever expanding selection of music, which can then be streamed instantly. It’s like having iTunes preloaded with the world’s music.

It’s probably better explained by them:

The free version is supported by occasional adverts between tracks and every so often you’ll see a banner ad within the player. At its current level it’s not enough to push me to subscribe and it’s certainly not as bad as commercial radio stations that devote more airtime to ads than music.

Its available from spotify.com

Now if only Last.fm could generate Spotify playlists from its recommended music…

Newer Posts
Older Posts