Modifying the basic comments display

Socrates Premium Wordpress Theme

Socrates Premium Wordpress Theme

Get Instant Access

Because this is the Web and not a paper magazine, there are WordPress features I should take advantage of. I want to show what "Column" (a.k.a. WordPress category) the article has been posted to. I also want to take advantage of having people's comments and ideas on the article and help keep it fresh. So, I'll show how many comments have been added to the post. But again, some editing will need to happen, as I don't want those two items lumped together at the end of the article section. I've already moved my category template tag up next to my author name display, so what I'm left with is this:

<div class="comments"> <div class="commentIcon"><?php comments_ number("No Comment's,"<span class="bigNum">1</span> response","<span class="bigNum">%</span> Comment's); ?></div> <?comments_popup_ link("Add Your Thought's, "Add Your Thought's, "Add Your Thought's);

You'll see in the preceding code that I've changed the comments_popup_link template tag to always display Add Your Thoughts and added the comment_number template tag to track how many comments are made on an article. I've also again added my own custom classes called comments, commentsIcon, and bigNum to the markup and changed it from a paragraph tag to a div tag. (So my "left" and "right" float assignments would work within it.) It looks like this:

Even though I had most of these text elements handled in my mockup, I'm now seeing what's available to me via the WordPress template tags. You've probably noticed that the classes authorName and bigNum were not the part of my original mockup. I've decided to add them in as I'm developing the WordPress theme. This is the kind of thing I was discussing in Chapter 2's overall strategy. By making sure the XHTML/CSS mockup was handled well using more "generic" or high-level XHTML objects and container div tags, it's now very easy to add finishing touches and details within the template by taking advantage of CSS inheritance.

I thought that making the author's name just a little smaller would offset it nicely from the article, and as I created the comment icon, it would be cool, if there were comments, to show them in a big number floating in the middle of the icon.

You will probably come across a few details like this yourself; feel free to add them in as you see it. As long as your changes don't drastically change the layout, your client will not mind. If you think they will, it might be best to add to your original mockup and send a screenshot to the client for approval before proceeding.

Upgrading from 2.5 to 2.7+ — making sure your sticky post "sticks":

If you copied over the loop from the default theme of a 2.7+ installation, you're good to go. Mark a post as "sticky" in the Administration panel and you'll see your .sticky class, which we created in Chapter 2, at work.

Edit Posts

Alf (6 Published (6)

Bulk Actions - Apply Show alf dates View a!! categories Filter ri Fun with 002

Features, Office Productivity lorenn ipsum, you tube

QUICK EDIT Categories [more)

Title Why Linux is Hackproof (and what that ft ^ Features

Q Office Productivity Slug why-llnux-is-hackproof-and-what-that- r-, Qn The NcwWetl

Q Print

D Private post

Search Posts

Bulk Actions - Apply Show alf dates View a!! categories Filter

] Post






Apple Boston now Open!

jai me

Mac Stuff, On The New Web

No Tags

Was this article helpful?

0 0
Blogging For Maximum Profit

Blogging For Maximum Profit

Working Hard, Working Smart or Both; Without The Right Plan, You're Working For Less Than You Could Be! Do You Have A Plan For Making Some Serious Cash With Your Blog NOW? Then download Blogging For Maximum Profits.

Get My Free Ebook

Post a comment