25
…AND GETTING YOUR HANDS DIRTY A BEGINNER’S GUIDE TO POPPING THE BONNET… SCOTT HUNTLEY

A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

Embed Size (px)

DESCRIPTION

My Slides from #WCSyd.

Citation preview

Page 1: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

…AND GETTING YOUR HANDS DIRTY

A B E G I N N E R ’ S G U I D E T O P O P P I N G T H E B O N N E T…

S C O T T H U N T L E Y

Page 2: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

I A M N O T A B L O G G E R

Okay, sure, I write articles from time to time for TAFEbytes, a blog by TAFE teachers.

8 articles in 15 months, that’s not too bad.

I suppose you could say I run my wife’s photoblog (CLHuntleyPhotography.com)

We just got around to posting our Floriade photos.

Floriade 2013, that is.

Page 3: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

I A M N O T A D E V E L O P E R

I was writing this very cool SmartTour Web App in PHP…

…in 2010.

I never finished it.

It didn’t use WordPress as the backend*

*but I have been so totally inspired to redo this project using WordPress as the backend, I just haven’t found the time

Page 4: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

I A M N O T A D E V E L O P E R

I haven’t written any plugins* or any themes.

*I have been so totally inspired to write a plugin for my wife’s photoblog, I just haven’t found the time.

Page 5: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

S O T H E N W H O T H E H E L L A M I ? A N D W H Y A M I P R E S E N T I N G AT W O R D C A M P ?

“Those who can, do; those who can't, teach.” - George Bernard Shaw

“Actually Mr. Shaw, it’s teaching and assessing.” - Kenneth Scott Huntley

I’m a teacher at Miller College, South Western Sydney Institute of TAFE

Page 6: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

S O T H E N W H O T H E H E L L A M I ? A N D W H Y A M I P R E S E N T I N G AT W O R D C A M P ?I’m a teacher at Miller College, South Western Sydney Institute of TAFE

• Social Media

• HTML & CSS, even a little jQuery

• Customise Content Management Systems

• ICAWEB416A Customise content management system

• ICAWEB507A Customise a complex IT content management system

• And specifically, we use WordPress!

Page 7: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

W H O I S T H E T Y P I C A L M I L L E R S T U D E N T ? A N D H O W M I G H T T H I S M AY A P P LY T O Y O U ?

Certificate IV and Diploma of IT General

• This means they learn a little bit of every thing

• Thus, they are not programmers

• They learn a little VisualBasic

<Insert audible gasps and much dissatisfaction from the crowd here>

Page 8: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

W H O I S T H E T Y P I C A L M I L L E R S T U D E N T ? A N D H O W M I G H T T H I S M AY A P P LY T O Y O U ?

So, they don’t know how to code in PHP.

But they have to customise a Content Management System.

Can you mod WordPress knowing almost no PHP?

Can I teach you some simple WordPress mods that will give you confidence to mod the PHP? And can I do it in 45 minutes?

Page 9: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

W H E N Y O U A S S U M E …

Let’s assume that you know…

…what an if statement is.

…what a while loop is.

…what a variable is.

That’s all you need to know.

Page 10: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

W H E N Y O U A S S U M E …

In all seriousness, in this presentation is not going to be code heavy.

In the demos, I’ll put some PHP code up on screen.

I’ll talk you through what the code is doing.

And I’ll show you where to put the code.

The point of this presentation is to show you that you don’t have to be a code monkey to do some basic mods to your code.

Page 11: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

C T R L - Z ! C T R L - Z ! C T R L - Z !

This should go without saying but…

…let’s not play with a live site. Like your live site. The one you’ve been putting lots of work into. The one that you can’t afford to break.

Let’s build a sandbox site instead.

Page 12: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

W H AT T H E FA M O U S F I V E M I N U T E I N S TA L L S K I P S . . .

Our first mod isn’t really a mod.

The famous five minute install skips adding salts.

Let’s mess with our wp-config.php a little…

Page 13: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

T H I S S E M E S T E R ’ S A S S I G N M E N T

In our Diploma course, I randomly assign the students a simulated client.

They then have to customise a WordPress blog for their client.

Let’s take a look at some of the tasks I’m asking the current group of disinterested pupils aspiring scholars to undertake.

Page 14: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

T H I S S E M E S T E R ’ S A S S I G N M E N T

Task 3:

You are required to create a child theme based on either the theme Twenty Twelve, Twenty Thirteen, or Twenty Fourteen.

Page 15: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

T H I S S E M E S T E R ’ S A S S I G N M E N T

Task 4:

Modify the Dashboard. Specifically, you are to:

a. Add your client’s logo to the Login Screen

b. Add a custom dashboard widget that welcomes them to the CMS, and provides your contact details (email address, phone number) for them to contact you if they need support.

Page 16: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

T H I S S E M E S T E R ’ S A S S I G N M E N T

Task 5:

Your client has requested “upcoming events” functionality for their blog. To implement this feature, you have decided to create a Custom Post Type for Events.

Page 17: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

C H I L D T H E M E S

What is a Child Theme?

According to the WordPress Codex:

“A child theme is a theme that inherits the functionality of another theme, called the parent theme.

Child themes allow you to modify, or add to the functionality of that parent theme.

A child theme is the best, safest, and easiest way to modify an existing theme, whether you want to make a few tiny changes or extensive changes.

Instead of modifying the theme files directly, you can create a child theme and override within.”

http://codex.wordpress.org/Child_Themes

Page 18: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

C H I L D T H E M E S A N D C U S T O M C S S

What is the best way to modify a theme’s CSS?

In this demo, we’ll create a child theme, and write some ugly CSS. (And do something useful, like making part of their theme disappear.)

Page 19: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

A D D I N G O U R L O G O T O T H E L O G I N S C R E E N

It’s always a nice touch for our client’s to see their logo in the login screen. This isn’t too hard.

In this demo, we’ll modify functions.php.

Page 20: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

A D D A C U S T O M D A S H B O A R D W I D G E T

Next, we are required to add a custom dashboard widget.

• In our case, to include our contact details.

• Maybe there’s something else you might want to add to the backend of your blog?

In this demo, we’ll create a plugin that adds a dashboard widget.

Page 21: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

C U S T O M P O S T T Y P E S

I promised to show some custom post types too.

But then the schedule for WordCamp was published…

Page 22: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

C U S T O M P O S T T Y P E S

Mastering Custom Post Types by Ajax McKerral (Sunday 12:15)

“Getting to the bottom of creating custom post types, and how this can benefit your clients.

Learn how to declare them, label them, add taxonomies and make them navigable in the Dashboard.

Then learn how to build templates for them and take full advantage of core WordPress functionality to make yours and your client’s life easier.”

…and I saw this. !

I don’t want to be repetitive. !

It looks like Ajax’s presentation will cover this

topic in more depth.

Page 23: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

S O I N S T E A D …

Let’s put an ad after the first post.

In this demo, we will modify the WordPress loop.

Page 24: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

S O W A S T H I S H A R D ?

No.

These tasks were all taken from tutorials published online (and with a little help from the WordPress codex).

• Look for these tutorials

• Don’t be intimidated by them

• You don’t need to be a code monkey to work through a WordPress tutorial. Or book. Or whatever.

• A good tutorial will talk you through the code…

• …and maybe even set you on the path to becoming a code monkey.

Page 25: A Beginner's Guide to Popping the Bonnet and Getting Your Hands Dirty

Follow me on Twitter: @MillerTAFEScott

Tweet WordCamp: #wcsyd

Join the local Meetups: www.meetup.com/WordPress-Sydney

!

!Credits:

Guillaume Voisin How to Build Custom Dashboard Widgets http://goo.gl/oGNYk9

Conor Turnbull 12 Useful Customization and Branding Tweaks for the WordPress Dashboard http://goo.gl/9eLDJv

Harish Chouhan Customizing the WordPress Dashboard For Your Clients http://goo.gl/VHGmxD

Jean-Baptiste Jung 10 Useful WordPress Loop Hacks http://goo.gl/gzYtgd

Photo by Duncan Miller Photography https://flic.kr/p/7Z25ev