Pressing onward, and upward, with WordPress
May 26, 2010 5:02 AM   Subscribe

What can I do for 30 minutes a day to improve my WordPress skills from "intermediate" to "advanced"?

Almost all the projects I work on as hobbies are now using WordPress as a platform in one way or another. I'm stumblingly familiar with the structure -- I know how themes work, the difference between index.php and page.php, etc. I've worked my way through the Small Potato "Build a Theme" tutorial. I'm basically okay with the fundamentals of CSS. I know my way around HTML. This question, for instance, covers stuff I've already figured out for the most part.

But every time I want to do something that's not "out of the box" functionality for WP -- which is often -- I suddenly feel totally lost. As a f'rinstance, I'm currently trying to figure out how to (a) find (b) identify and (c) display the auto-generated thumbnails for WP 2.9 so that individual category pages will have a box at the top with the thumbnails and titles for the most recent entries in OTHER categories. I get as far as using Firebug to identify the div the images are appearing in -- and then I blank in the face of a sea of PHP, core functions, and code.

I'd like to get myself up to the same level as the folks that make plugins and widgets -- or at least to a level where, if I install a widget, I can look at the widget code and understand what it does, instead of just trusting in its wizardry.

What do you recommend for somebody who is reasonably intelligent but not especially "computery," who wants to dive into the core and start really understanding how to make WordPress 2.9 work for me? Ideally something I could tackle during lunch breaks at work -- figure 30 minutes a day.
posted by Shepherd to Computers & Internet (8 answers total) 43 users marked this as a favorite
 
You need to learn Php to move to the next level. Take a look at this thread.

Writing the code from scratch would be a big step but you first need to learn how to read it and tweak it. FWIW, I learned beginner level C# and found it relatively easy to read php.
posted by Danniman at 5:24 AM on May 26, 2010


I'd like to get myself up to the same level as the folks that make plugins and widgets

I've found the trick is to abandon plugins and widgets first, and either put the necessary code directly in a template, or indirectly through the function.php.

For which, indeed, basic knowledge of how php works is a plus.

After that, it is useful to know which hooks Wordpress uses natively.

Sites like WP Recipes.com or WP Engineer are useful to get knowledge like that.
posted by ijsbrand at 5:43 AM on May 26, 2010


Thirding that you will need to learn at least basic php to get to the advanced level. Or at the very least, not be afraid of it. I have found that most of the php I use within Wordpress is based around echo-ing, and boolean logic/conditionals. I would say that having a solid understanding of if/else/for/while statements is crucial for Wordpress - the Loop is essentially a mess of nested conditionals.

Forget about widgets for small things (like making a thumbnail post), and look into custom fields. (tutorial for thumbnails w/ custom fields). Smashing Magazine has a good number of tricks with custom fields.

Learning how to make a theme, or tweak an existing one to your liking, does have a lot to do with CSS and HTML - but for advanced customization, you're probably going to want to become friends with the codex. To spend a half hour a day in the wordpress lessons? You'd probably pick up a LOT.

I find that I learn best when I have a specific problem to solve. So, give yourself a problem (start simply) such as "How can I display my mood at the bottom of a post" or (a little more advanced) "How can I put a list of the most recent posts into my template WITHOUT using a pre-made widget?" Another fun one is "How can I make multiple widget boxes?" The answers are out there - you could potentially get each of these tasks completed in a few half hour sessions as you are just starting - and once you pick up a few small successes, you may find yourself rolling down the road to Wordpress Mastery.
posted by kellygrape at 6:43 AM on May 26, 2010


Response by poster: Not trying to steer my own thread, but since we're getting a fairly unanimous chorus of "learn PHP" here, can I broaden the question to recommended resources for picking up PHP?

Follow-up question: W3Schools says I need JavaScript before moving on to PHP: is that true, and is JavaScript relevant to my needs, or would I be better off looking elsewhere?
posted by Shepherd at 6:55 AM on May 26, 2010


Best answer: I know PHP. I don't know Javascript. I learned basic Java as part of my intro to computer science classes, but I have not spent time learning Javascript. So, while it might be helpful, it is certainly not critical.

If you're looking to become a better web developer in general, you might want to learn JS. You may find, in your quest to become awesome at WP, that you want to learn JS to do some more advanced stuff. But since your question is about Wordpress, go for PHP first.

Start here, at Wordpress's "Know Your Sources" page. This also appears to be a good introduction. And I'm sure a search on AskMeFi will bring out many, many more recommendations (such as the thread that Danniman recommended). Just working through the Wordpress codex and making stuff for various installs has taught me a whole lot.
posted by kellygrape at 7:08 AM on May 26, 2010


Best answer: One of the things PHP got right first was putting all its documentation online. If you want to learn about a function, say, echo, you need only go to http://php.net/echo. All PHP functions are linked in that way. So when you see a bit of PHP in a theme or plugin and you wonder how it works, try and learn what it means. So, here's a bit of common code in WP themes:
<?php if ( function_exists('dynamic_sidebar') && dynamic_sidebar('my-sidebar-widget') ) : else : ?>
<?php endif; ?>
So, here's function_exists(), but dynamic_sidebar() is not there. It's in the codex: dynamic_sidebar(). Learn how to look those functions up and understand better the code you have already gotten used to, and you'll have a better sense of how they work. Likewise, if there are tons of themes and plugins whose code you can inspect and play with. Set up an experimental blog, and play.

In terms of learning PHP, everyone learns differently. I tend to open up a page and start coding, testing, seeing the result, do research, and learn. Some people like tutorials. Some use sites like stackoverflow when they get into deep water.

One of the things that I think is most important if you're coming from WordPress is to learn there are differences between functions like the_content() and get_the_content(). The convention in most WordPress themes is for things to echo immediately, whereas if you're trying to do something complex, you might need to store and modify what WordPress gives you before you echo it out. Here's one of my own thingamajigs: it stores the output of get_the_archives(), munges it, and then displays it. Here's an archive links visualization, and the code behind it.

I say read and learn Writing a Plugin and Theme Development -- really learn them as best you can and that will take you much of the way to being comfortable with WordPress programming.
posted by artlung at 7:52 AM on May 26, 2010 [4 favorites]


A few other people have linked to appropriate pages in the Codex on writing a plugin or editing themes. You can also check out videos at http://wordpress.tv that introduce you to plugin development, etc. The WordPress project will be working on creating some open source learning materials this summer to help with the situation you describe, with the intention of having some easy-to-follow handbooks to help ramp up people in your position.

To your original question of what you can do for 30 minutes a day to up your skills, I'd say just start experimenting. Have the Codex at hand, watch a few tutorials, but dig in and just starting to edit plugin files to see what happens (on a test site, not your live site, of course); it is one of the best ways to learn.
posted by jenwells at 6:06 PM on May 26, 2010


Best answer: 30 minutes a day, eh....

If you can explain / understand where *everything* on a generated Wordpress page comes from, then you understand Wordpress. As you explore, you'll *by necessity* have to learn PHP, and understand the calling/evaluation order of WordPress stuff. Hopefully you'll learn a little about the database backend as well.

(I'm assuming you're on windows, but correct me! Windows has *very poor* programming tools in general, so the command line (cli) isn't that helpful. I'd install cygwin or something, so one can have Real Tools (tm) available like 'diff' and friends. If you have a Mac, then you have a good cli available. Learn to use them! 'diff' some files for example.)

Day 1: Download the wordpress source code, if possible using a proper source controlled version (one of: git, mercurial, subversion). Keep a 'pure copy' around. Panic, and be overwhelmed. Start a learning log with 'insights' and key lessons you learned each day.

Day 2: Install the thing live. Learn a basic Apache install. Panic and be overwhelmed. Install a 2nd install locally, so that you can break things without worrying.

Day 3: Join StackOverflow and read WordPress related questions. Some will be obvious (and answerable) to you. From time to time as you're learning check back in on SO to see how much you're learning, by seeing that over time, more answers are obvious to you.

Day 4+: So, each day, choose a section, or a page type, and dig into it. Modify the source code if necessary to "break" and "alter" pages. Send headers to the bottom of pages (using css). Make elements disappear. Change date formats. Figure out how the db works. Alter data in the db by hand to see it appear on the site. Any time you make a change, make sure to put some comment with your initials in it (or some other searchable phrase) so you can "get back" to clean state.


Personally, I find the WordPress codebase to be quite mishmashy and poorly written, so it's not the most trivial task. It mixes logic and presentation quite heavily. I also quite dislike PHP :) That said, there's lots of work out there modifying templates, and learning a *whole project* like wordpress will be very instructive!

Best of luck!
posted by gregglind at 9:19 AM on May 27, 2010


« Older Why is my Mac acting like these programs are...   |   Withdrawal. Newer »
This thread is closed to new comments.