Survival CSS

In class this week I talked about Survival CSS—knowing enough CSS to be able to troubleshoot an issue with a plugin or change a color of an element of your Theme.

CSS stands for Cascading Style Sheets. The “Style Sheet” part means just what it sounds like—it’s what gives a web page its style and appearance. The “Cascading” part means that you can have multiple style sheets applied to the same web page; styles get processed in order and later or more specific styles “win”. That’s what will let us tweak our CSS without actually editing the original CSS files—we can add our own CSS styles into a special style sheet that gets applied last of all to our blog, so it’ll always win.

A CSS style consists of a selector (what part of an HTML document the style will be applied to) and then pairs of properties and values assigned to that property.

For example, if we wanted to set the font and color of everything in a paragraph tag in our HTML, the CSS would look like:

p {
font-family:”Helvetica Neue”,Helvetica,Arial,sans-serif;
color: black;
}
To get more specific in CSS, we can assign a class or id to tags. In survival CSS, you’re mostly going to be dealing with classes and ids that have already been set up in the themes you’re using. Classes are noted with a period and ids with a hashmark.
One of the most common things you’re going to want to edit in CSS is the color of something. Colors in CSS can be represented in several ways and the most common are:
  • As names—140 colors have specific names in CSS, ranging from common colors like blue and red to things like mediumorchid.
  • As RGB (Red, Green, Blue) values in hexadecimal notation. For example, blue is #0000FF, red is #FF0000, and mediumorchid is #BA55D3.
  • If both the numbers in each pair of RGB values are the same, a shortcut is to simply type the repeated digits once. So blue is #00F, red is #F00, and mediumorchid cannot be written with this shortcut, because the BA and D3 pairs are each different.

Let’s say we’ve got a Theme we like for our blog, but we want to change the color of just the description text under our blog name. In any of the major browsers, right-click on the description and choose “Inspect Element”. This will open a new panel in the webpage that shows you the HTML of that part of the page and the CSS that is being applied. Each of the browsers deals with this slightly differently and I happen to like the one in Chrome.

inspect-element

In the CSS panel we see all the different styles that are being combined to produce this section, in reverse order. If you scroll down the list you’ll see more and more elements with a line through them, indicating that they’re replaced by a later direction above. Right at the top we can see that the element we’re interested is part of the header and has the id “description” and is getting it’s color from a style that contains a few other properties as well:

header #description {
color: #888;
margin-bottom: 40px;
font-style: italic;
}

To change that color, we’ll go to our WordPress dashboard to Appearance > Edit CSS and create a style that overrides just the color definition.

header #description {
color: red;
}

Ta Da!

Look, My Text is in Red

You Want Links? I’ve Got Links.

In class this week, Sam presented our single Blog Talk. She presented Peanut Butter Fingers, an interesting cross between a personal blog and a healthy eating/living blog.

Our guest speaker this week was Keidra Chaney of The Learned Fangirl. She mentioned a bunch of interesting sites during her talk that I wanted to document for my own purposes, and this is as good a place to do that as anywhere:

This idea of the “note I’m keeping for myself, but I might as well share it with others”, has anyone expressed that more eloquently? Of course they have. Long-time blogger Cory Doctorow wrote in 2002: My Blog, My Outboard Brain.

Survival HTML

Last week in class we talked about “survival HTML”—knowing at least enough HTML to be able to troubleshoot your posts when the Visual Editor in WordPress has failed you and you need to dive into the Text side, or similar situations with widgets or a wonky theme. A couple of resources if you want to explore that further:

  • HTML Dog has some well-written tutorials covering all the basic HTML elements and Intermediate and Advanced sections as well.
  • W3Schools isn’t quite as cleverly written, but they have a “Try It Yourself” button built into every page that lets you work with the tags in an interactive editor/browser.

Blog Talks

Every week a couple of students in our class are presenting favorite and/or interesting blogs. Perhaps they will be of interest to you as well. Here’s what we’ve seen so far this semester and I’ll post future weeks’ Blog Talks throughout the semester.

9/9

Lorenzo – http://www.favoritepoem.org/
Maggie – http://www.danamadeit.com/

9/16

Rachel – http://abeautifulmess.com/

9/23

Deanna – http://chicityfashion.com
Bridget – http://www.intothefashion.com

9/30

Ashley – http://ourcitylights.org
Amelia – http://blackgirllonghair.comhttp://naptural85.com
Gianna – http://refinery29.com – http://lovelaurenelizabeth.com
Anna-Laura – http://abduzeedo.com

10/7

Megan – http://mollyjacquesillustration.com

Akismet

A couple of weeks ago I asked you to install Google Analytics and/or Jetpack, so you could start collecting analytic data. If you haven’t already done so, you should, and ask in class if you need help. In that post I breezily mentioned that getting a WordPress.com account, like you need for Jetpack, would also let you enable Akismet, to fight comment spam. I was reminded in class that there’s a little trick to the Akismet setup that you should probably know.

When you go to Activate the Akismet plugin, you’ll be prompted to get an Akismet API key. The sign-in for that is your WordPress.com login, and then you’ll be prompted to choose between Personal, Business, or Enterprise plans: choose Personal. The Personal sign-up screen has fields for you to put in your credit card, but don’t! (I mean, unless you really want to support their efforts: but I’m not asking you to shell out any more for this class.) Instead, notice the slider in the upper right of the form that asks how much the service is worth to you. Slide the slider all the way to the left to $0. You’ll get a little frowny face, but the credit card fields go away and become a Continue button. Press that and you’ll get your Akismet API key, which you can then use to activate Akismet on your blog.

Back Up Your Blog!

I mentioned this in class a few weeks ago and showed you where a simple backup function is, but it bears repeating: Back Up Your Blog. Especially since we’re using the blog as the main place where your graded content lives, you’ll probably want to make sure that in the unlikely event something happens to your blog that you have a backup.

On the administration sidebar is Tools and under that is a choice for Export. If you leave All Content selected and click Download Export File, WordPress will generate a single file that has all your Posts, Pages, and any Comments you’ve received. It will not have any of your uploads (images, etc) but that does mean for your new blog it’ll be a very small file. The export for this blog right now is 74 KB, which is about the size of a normal Word document. It makes it easy to email it to yourself, or throw it on a USB drive, or put it on your Dropbox or Google Drive. The file even has the date included in the name, so you can keep multiple versions of the backup.

There are plug-ins you could install that will automate backups for you, either storing them on the server (which probably won’t work on our server, given how locked down it is), or emailing it to you automatically.

Pages, Categories, Tags, and Menus

There seemed to be a little bit of confusion between Pages and Categories, so it seemed like something we should go over.

A Page in WordPress looks a lot like a Post—it has a title and a body section and when it’s published it usually (depending on your Theme) gets all of the same surrounding menus, widgets, etc. But it sits apart from the main flow of your blog posts and readers can only find it if you specifically link to it or include it on a Menu. Pages are usually used for information that you want to be always accessible to your readers, no matter how long ago wrote it: your About Me, how to contact you, legal disclaimers, a glossary of technical terms, etc. Pages can have a parent-child organizational structure and you can, in fact, use them to use WordPress to make static websites, like a “brochure site”.

Categories are an organizational  classification that gets applied to a Post. Categories can have many Posts assigned to them, and  Post can be assigned to multiple Categories. Categories can be a great tool for your users to find similar posts on a topic they like your writing on, and can be a useful organizational tool for you as a writer. As a general rule, you’ll probably want to have a few broad categories, with maybe a few levels of child-parent nesting. If you get too specific with categories, it’ll take longer for you to manage the categories and it’s more work for your readers to use them to find posts. You can also add Categories right from within the Add New Post window, so it’s something you can manage as you continue your blog.

Tags are another organizational scheme, but are designed to be even more granular. If your blog is informational, they can add a powerful mechanism for your readers to find posts on specific topics. They have also factored in some SEO efforts, so you’ll see blogs where people have gone a little crazy with the Tags.

As an example of the difference between the two concepts, let’s think about a blog about candy. You’d probably want some categories like Chocolate Bars, Hard Candy, and Gum. Over time, you might find that your readers really care about whether chocolate bars have nuts or not, so you could add With Nuts and Without Nuts as child categories of Chocolate Bars. Tags, on the other hand, could be used to include information about specific ingredients of the bar being reviewed (“cashews”, etc.), or to indicate information about the availability of a bar (“British” or “seasonal”), or even to include a rating (“1-star”, “2-stars”, etc).

Pages and Categories are often made available to your readers with a theme widget on the sidebar or footer of the blog, but to really highlight them, you’ll probably want to make a Menu. Menus can be created and managed under the Appearance section of the administration sidebar. You have to make a Menu before you can edit it—if you’ll only going to have one, just call it something like “Main”—and then you can drag items from Pages, Categories, and Links over to your Menu and re-arrange them by dragging them around inside the list. The Manage Location tab shows you where your theme will let you place the Menu.

Test Child Post

This post, on the other hand, will be in the Test Child category. Makes sense, given its title.