This is a quick post on using Javascript and the JQuery framework in particular within your WordPress theme. It’s quick and pretty painless. This is just for regular themes, not admin themes, plugins, or posts.
Step 1:
This is a quick post on using Javascript and the JQuery framework in particular within your WordPress theme. It’s quick and pretty painless. This is just for regular themes, not admin themes, plugins, or posts.
Step 1:
Content Management Systems and WordPress is so powerful because it allows site owners to update their sites efficiently and to customize their sites and their CMS experience. WordPress themes control both the look of a site and the options a site owner has in terms of customizing this look.
That sounds pretty good and rather vague. It’s hard to describe what you can do with WordPress themes, since they can do a lot. It’s like trying to describe all the things you can do with a nail. It all depends on how you use it.
In light of this, it seems like the best thing to do would be to go through an example of building a WordPress theme. I’ll go through a theme as I develop it, and I’ll try to build it starting at the simplest level and working to progressively more complicated iterations.
Before we begin, there’s a few things that I’m going to assume:
You can feel free to skip this entire article if you have a website that you are happy with… hold on, there’s something else… and you can easily update it. Notice that I said you, not your latte drinking, jargon spouting, charge by the hour web air quotes consultant.
One of the main reasons to use a content management system is to enable you to update the content, and sometimes the look of your site. A CMS (I’ll explain what it is soon) should enable you to do this in a painless way. In other words, without cracking open any sort of O’Reilly book with “the Definitive Guide” somewhere in the title.
Grep and piping ( | ) are two powerful tools in Linux. Grep allows you to search lines of text for certain patterns using regular expressions. Piping allows you to take the output of one command and make it the input of another.
So, lets say you want to look through the Odyssey and find all mentions of Sirens. That would be:
grep -in siren odyssey.txt
But let’s say you don’t have the Odyssey on your hard drive, you could just get it from MIT and pipe it over to grep
curl http://classics.mit.edu/Homer/odyssey.mb.txt | grep -in siren
In both cases, I used case insensitive search, grep -i, and I list what line number the instances are found on with -n.
So far this has all been pretty straight forward, but I know that the Odyssey is divided into books, and I want to know which books contain the lines about sirens. This is where piping becomes very handy.
curl http://classics.mit.edu/Homer/odyssey.mb.txt | grep -in "siren\|^book" | grep -iB1 "siren"