Ryan Paul

Freelance WordPress web developer, specializing in creating fast and practical WordPress powered websites.

LOTW Health Sciences

The Lake of the Woods Health Sciences Campus administers the local delivery of medical education by creating environments where learners, teachers and practicing physicians can excel. The ultimate goal is to maintain the highest standard possible for health care delivery.

The client contracted my employer to create a portal where students could find relevant information and contact the faculty, a Members area where staff could view events, download meeting minutes, and see urgent board notices.

I built this fully responsive website using Bootstrap 3, CSS3, and with minimal reliance on plugins.

Ryan’s Useful Options WordPress Plugin

This plugin amongst other things adds a front end ‘Delete’, ‘Edit’, and ‘Logout’ buttons, removes attached media from deleted posts/pages, turns off self pingbacks, removes styles from tag clouds, cleans up what’s outputted from the wp_head function, and protects a page and its ancestors through requiring user login by defining page slug of parent page.

It also adds Bootstrap tables, forms, and button CSS to the front-end of this website without adding any typography or other styles included with Bootstrap, and an “is_child()” function which you can use in your template.

Useful WordPress Stuff

I’m constantly looking and re looking for various tiny tricks and tips I’ve used over the years on multiple WordPress powered websites. I’ve grown sick of trying to remember which sites, and so I’ve spent a few hours compiling this list. This list is primarily for my own use, but if you should find it helpful… then knock yourself out 🙂 This list will definitely be expanding so I can use it for a one-stop-shop for every website I build.

But for now folks.. I hope you find this stuff useful.

I’d love to hear from people if anyone uses these… so leave a comment!

You plum!


Add Comments Delete & Spam To Front End:

function delete_comment_link($id) { 
if (current_user_can('edit_post')) { 
echo '| <a href="'.admin_url().'">Delete</a> ';
echo '| <a href="'.admin_url().'">Spam</a>'; 
} 
}

 

Add the following after edit_comment_link()

if( function_exists('delete_comment_link') ) { delete_comment_link(get_comment_ID()); }

Set a maximum number of post revisions to avoid DB bloat:

if (!defined('WP_POST_REVISIONS')) define('WP_POST_REVISIONS', 5);

Display All Settings Link:

function all_settings_link() { add_options_page(__('All Settings'), __('All Settings'), 'administrator', 'options.php'); } add_action('admin_menu', 'all_settings_link');

This will display an extra ‘All Settings’ link in your Settings menu


Individual Dynamic Link To A Post / Page:

<a href="<?php echo get_permalink(1); ?>"><?php echo get_the_title(1); ?></a>

This will output a single dynamic link to a post or a page.


Individual Dynamic Link To A Category:

<a href="<?php echo get_category_link(1); ?>"><?php echo get_cat_name(1); ?></a>

This will output a single dynamic link to a category.


Front End Delete Post Link For Authorised Users with Javascript Double Confirmation

If you don’t have a functions.php in your WordPress theme, create ‘functions.php’ and add this function to it – preferably at the top.

<?php 
    function wp_delete_post_link() {
    global $post;
    if ( $post->post_type == 'page' ) { if ( !current_user_can( 'edit_page', $post->ID ) ) { return; } }
    else { if ( !current_user_can( 'edit_post', $post->ID ) ) return; }

    $delLink = wp_nonce_url( get_bloginfo('url') . "/wp-admin/post.php?action=delete&post=" . $post->ID, 'delete-post_' . $post->ID);
    $variable = $post->post_title;
    $variable = str_replace( "'", "\\'", $variable);
    $variable = str_replace( '"', '\"', $variable);

    $url = get_bloginfo('url');
    if (current_user_can('edit_post', $post->ID)){ echo "

Delete

"; }
    }

function javascriptdeletecheck() { ?>
<script type="text/javascript">
<!-- 
if (self != top) { 
	if (document.images)  { top.location.replace(window.location.href); }
    else { top.location.href = window.location.href; }
	}

function checkStuff(val) {
	var check1=confirm("YOU ARE ABOUT TO DELETE A POST ENTITLED:\n----------\n\n "+val+"");

if (check1) {
	var check2=confirm("Are you 100% sure, because you won't be able to get it back?");
	if (check2) { return true; } else { return false; }
	}

else { return false; }
}
-->

</script>

<?php } 
add_action('wp_head','javascriptdeletecheck');
?>

Then add the following into your template within The Loop wherever you wish the delete link to go.

<?php wp_delete_post_link('Delete', ' [ <strong class="delete">', '</strong> ]') ?>

Front End Delete Comment Link

 

Open ‘comments.php’ and look for the edit comment link which will be something like:

<?php edit_comment_link('Edit',' [ ',' ] '); ?>

and add the following after it:

<?php if (current_user_can('edit_post', $post->ID)) { ?><strong>[ <a onclick="return confirm('Are you SURE you want to delete this comment?')" href='<?php echo wp_nonce_url("/wp-admin/comment.php?action=deletecomment&amp;c=$comment->comment_ID&amp;_wp_original_http_referer=" . wp_get_referer(), 'delete-comment_' . $comment->comment_ID.""); ?>'>Delete</a> ]</strong><?php } ?>

Get Slug:

 

You should be able to put the code below into your functions.php… or into the html head of your theme:

<?php
$post_id = get_post($post->ID); // get current post or page
$slug = $post_id->post_name; // define slug as $slug
?>

Then use the following to echo the slug:

<?php echo $slug; ?>

Retrieve Post ID Outside of the Loop

 

Put this code into your functions.php:

function function_name() {
global $wp_query;
$thePostID = $wp_query->post->ID;
}

Then use the following to echo the Post ID:

<?php echo $post->ID ?>

Wind N’ Water

Wind N’ Water Interiors provides a high quality product and knowledgable staff.  They’d just opened up in Kenora and needed a web presence as a virtual showroom.

My employer was hired to create their website from the ground up.  I built this responsive template using Bootstrap.

REMR Roofing

Known throughout Northwest Ontario as a high performing company with solid service, the client wanted a website to reflect that.

Initially due to the previous company not updating Joomla and using outdated PHP modules to integrate an old version of WordPress with Joomla – this website not only was not responsive, but it loaded slow and was responsible for infecting 71 other client websites on the dedicated server.

We hardened security, informed the client that their website was blacklisted on Google and got to work.  The template was designed and I built it from the PSD from a blank template.  Every aspect of this website is dynamic – I used BX Slider to power the sliders on each page, post categories (designated by Custom Field on each page), and featured images to populate the sliders.

We recreated their Request a Quote, and Contact Forms and made sure those worked flawlessly. Lastly (as with all of our client sites) we installed and configured Bulletproof Pro to constantly monitor and reverse any unauthorised file changes.

First Nations Childcare

Firefly Northwest had obtained extra funding from the Ontario government to create a web portal for the childcare centres to use to collaborate and communicate with each other.  Many of the First Nations are remote communities and so communication via the internet is the easiest medium.

This template was built from the ground up without the use of a webkit like Bootstrap or PureCSS – all the responsiveness was created manually by myself. The site is broken up into five main sections, and each section has an area for news, downloads, maps, contact forms, and a message board.

Unfortunately – this website is behind a secure login.

Sioux Narrows – Nestor Falls

The township had a web presence stretching all the way back to 2001.  Eventually they decided they needed a website that reflected the appeal of their two towns, and a Content Management System to be able to easily update it.

An initial design was developed by us to reflect the rural nature of the area.  However, this wasn’t a responsive design and so towards the end of February 2015, we were hired again to create a new fresh design, and port it into a mobile friendly responsive template.

This website makes heavy use of Custom Fields in the Business Directory Listings, and has a Staff Only area for downloads, and an event calendar.

Firefly Northwest

Lake of the Woods Child Development Centre and Patricia Centre for Children and Youth combined into one organization, and were renamed Firefly Northwest.

The new organization wanted a fresh design reflecting their work with children of all ages.  My employer was hired to create a portal that the community could use to interact with the organization, find information on services offered, and find out times of community events which Firefly were participating in.

This site features a staff portal which has an events calendar, staff downloads, public downloads, a public events calendar, sections for each community served, as well as downloads for each community.

KMTS

Initially Kenora Municipal Telephone Service was owned by the City of Kenora. After Bell bought KMTS for $30million – my employer was hired to do a complete overhaul and redesign inline with Bell’s corporate branding.

This monster of a web site in it’s initial stages had over 12,000 lines of PHP, more than 420 pages, and 4200 Custom Fields.  I spent four months working behind the scenes making sure every aspect of this site was dynamic and could be updated without any template modification.

When Bell bought Northerntel, and then integrated NorthernTel customers with Bell Mobility, a huge portion of the KMTS website was simply deleted and customers were redirected to Bell.

Compass for Success

The client came to us wanting a complete rebranding and website redevelopment for their flagship product – Compass For Success.  Compass for Success is a sophisticated education software solution developed to bring relevant and timely data to teachers and administrators to guide their work and improve student outcomes.

As they were using old web technologies, my employer was hired to recreate the website with a fresh design and brand new Content Management System.  Featuring all the standard sections most websites have, there is also a huge Members Only section which features a message board, live chat, file downloads and monitoring, and automatic email list integration.

Century Cinema

Built initially by another developer with various errors – I convinced the client that a mobile-friendly rebuild of the template was warranted by showing him server statistics.

One he gave the go-ahead, I created this simple WordPress theme from the original design using Bootstrap. This site relies heavily upon Custom Fields to show each Movie’s details.

LOWBrewco

My employer gained ownership shares in a local brewery startup and needed a web presence rather fast.

A one page theme featuring a very popular Shopping Cart powered by WooCommerce – we picked this pre-existing theme, installed it, and made final template modifications and additions.

Canadian Artillery

Perhaps my biggest website to date in terms of the sheer amount of data – the previous website ‘artillery.net’ was a big hodgepodge of broken links, urls, downloads and unorganized pages which was put together by a well meaning by not very skilled webmaster.

I was tasked with transforming the website into a well organized, clean, and easy to use portal.

Using a child theme of the freely available ‘Hueman theme’ for WordPress, I spent about five months reorganizing, correcting spelling mistakes, changing the way users navigate the website by using custom php and WordPress functions, putting the hundreds of downloads into a plugin to track daily usage, reattaching hundreds of featured images, changing the various profile based system into using posts integrated with corresponding parent pages, and modifying about 20,000 separate custom fields.

I also installed a security plugin that monitors and reverses any unauthorized file changes in the event of a server hack.

Treaty Three Police Service

The client purchased a template and wanted us to turn it into a mobile friendly template.

Using Bootstrap I created the website from the ground up using a couple of PHP snippets to enable the insertion of sliders using core WordPress functions and BXSlider.

Halley’s Camps

Northern Ontario’s biggest and best fishing and hunting business were using a company in Florida even though the business is in Kenora. That company had modified Joomla into oblivion. An outdated version of Joomla that couldn’t be updated had resulted in a monumental hack with thousands of database entries.

The client contracted my employer to convert their website to WordPress and make it mobile friendly.

In conjunction with another developer, I used Bootstrap to build the website, BXSlider for the sliders, and core WordPress functions to create a dynamic way of putting individual sliders (which utilize Featured Images) on each page/post using Custom Fields.

I used a custom ‘must-use’ plugin to make sure WordPress and plugins are updated automatically, and installed and configured Bulletproof Pro to monitor the website for file changes.

After that I assisted the client in migrating away from Godaddy and putting the website live.

The finishing touch was creating custom 301 redirects for the old URLs and resubmitting the site to Google using Webmaster Tools to remove the malware blacklisting.

NWO Bus

Running the school bus system for over 80,000 sq km – NWO Bus contracted my employer to create a portal for parents that would have web forms to apply for transportation and an email alert system.

I built this website initially from the ground up, and then on the client’s instruction recreated it in Bootstrap to make it mobile friendly.

At a later date the client decided SMS alerts were vital and cost effective and so I integrated an SMS Plugin to use Twilio to send out instant SMS alerts to 1100 parents. This increased customer satisfaction due to the fact SMS alerts are instantaneous.  Parents receive the SMS alert instantly on their phone instead of waiting far longer via email alert.

Sioux Lookout Airport

The Municipality hired my employer to create a website for the tiny remote airport.

Simple Paypal integration was required as well as dynamic fetching of an XML file to display arrivals and departures on the website.

There was many things I wanted to do with this website – including making it responsive but the time constraints and budget made it unfeasible.

Kenora Hospitality Alliance

The Kenora Hospitality Alliance is a group of local hotels who wanted a website created to highlight Kenora as a tourist destination.

After a huge hack due to old php coding from the previous developer – in conjunction with funding from the City of Kenora, my employer was hired to redevelop the old template into something new and responsive.

Using Bootstrap for the template, and Javascript for the menu, I built this template from the ground up. Everything is dynamic – from the sliders on each section, to the subsections under each menu item. Everything is controlled by careful use of custom fields.