Latest Entries »

So exciting!

Today’s my birthday, and for an awesome present I got my first post tutorial post published at WPTuts+.  It’s a beginner’s guide to using icon fonts in WordPress. Check it out when you have a few minutes – it’s a bit lengthy, but quite thorough.

Recently I developed a WordPress site that uses a custom post type for Events. This is a typical event page – note the More Info section in the left sidebar.

The client needed to be able to insert a list of links under More Info, and the number of links will change for every event. I needed a way to make this super-simple for the client, so in the Events custom post editor, the links are entered one per line like so:

Then, I needed to convert that line break-delimited list into an unordered list for formatting… I had no idea how to do that but after some hunting around I found this post that completely answered my questions.

Then in my single-events.php template, I have this section including the wonderful code snippet from wordpressismypuppet that converts the entries into a standard unordered list:

So now the result is a ul under ‘More Info.’ formatted to match the other sidebar widgets. The client has a bare minimum of HTML to contend with and has control over what appears in the list – everyone’s happy!

A list of handy Git resources for beginners.

The Program:


Git Commands

After Denver WordCamp back in November and a really well-done presentation by Jeremy Green, I decided it was finally time to dive into Git.

As a mostly-solo developer, I’ve felt ambivalent about it, but I know that it’s very important, if not critical, when working with a larger team. So…

I got my OS version of Git here. I’m not much of a command-line person so I also checked out some of the GUIs – the one that I liked (not knowing anything about it yet except that it had a pretty nice UI) was SourceTree from Atlassian. Jeremy had talked about BitBucket being a good choice for hosting private repos, and Atlassian also makes BitBucket. Seemed logical.

Then I looked at some resources and started with this one: TryGit. I liked ts friendly UI and the step-through examples, it was easy to get going but it quickly got into more advanced areas (I’m not there yet). This was a good starting point.

So in the next WordPress project, I resolved to just jump in and do this. Note: this is super-basic – I’m only using this on my local machine at the moment, so bear with me. This is for total newbies.

I opened up GitBash (the included SSH editor), navigated to my project folder and typed in:

This creates a fresh new repository (repo) of project files.

Then I’ll work on stuff for awhile. I can check out what’s happening with Git by typing:

This will show me a list of all the files in my project that have either not been added to Git, or have changed since the last time I added them. To add a file to Git so that it’s monitored, type:

But it’s easier to just add all the files at once:

Then check status again and you’ll see a list of files that are staged – they’re ready to commit, which means adding them to the repository. To commit all the files in staging:

Name your commits anything you like, just make it descriptive. You can view all your commits with:

Then I work some more, and when I get to a point where I feel I can give my commit a different name (i.e. I’ve finished a task), I type:

And so on. That’s it – very easy, not too intimidating with the command line, and you’ve removed so much risk with just these simple steps. I actually haven’t used the SourceTree GUI yet – for what I’ve done so far, I’m now happy with the command line.

Now that this process has become fairly automatic for me, my next step is going to be setting up a remote repo, probably with BitBucket, and learning how to do those parts of Git. And how to make branches.

I’ve been working on perfecting this for a month or so and finally have some code I can drop in to any responsive site that needs this type of menu. I hope this helps someone else – it’s an easy thing to implement. I used it  last week on my new personal site with some modifications (like closing the menu when any menu item is clicked).

This is a simple version of styling I used on a WordPress site recently for the newsletter signup and search widgets shown here.

© 2014 position: relative; All rights reserved. WordPress site maintained by WP Minder.