London Korean Links

Covering things Korean in London and beyond since 2006

Another tweak

So soon after the release of v4, here’s 4.1. My brain has been unable to stop fretting over getting better navigability on this site, including encouraging people to read more than the one article they land on when they google-search for a pic of Super Junior. First came the related post list a few days ago. Now I’ve done some additional styling to that list to separate it out from the main body of the post. I’ve also added another section encouraging people to click on the relevant post category, tag or author for other things which might be of interest to them.

But because most of the content on this site is written by one particular blogger (ie me), I didn’t want to include a link to the author’s other articles if the article you’re reading, like this one, is by that particular blogger. The resulting list would look just like the blog’s front page. So I needed to teach myself a bit of conditional coding, and here it is in case there are other WordPress users out there who want it.

Conditional link to author post list where the author is not the “main” author1

< ?php
if ($atr==2){ ?> < ?php _e('', 'plaintxtblog'); ?> < ?php } else { ?>Click here
for more articles by < ?php the_author_posts_link(); ?>. < ?php } ?>

Trivial, I know, but it takes up a lot of research and testing time if you’re a complete novice like me. It’s probably not the most elegant way of doing it, and the

< ?php _e('', 'plaintxtblog'); ?>

is a longwinded way of saying “display nothing”, but it works with these templates.

You won’t see it in action below right, because this post was written by me. Or rather, you’ll see it in action because there’s nothing there. But here’s one of Jennifer’s posts and you’ll see a link to all her other articles in the bottom-right section of the page.

The “Film Zone” page [now taken offline] needed similar amounts of effort. I found that none of the freely available “post list” plugins do everything I want them to, so I’ve been needing to get to grips with WordPress functions and template tags. And now I’ve discovered that all extra the brainwork which I’m asking WordPress to do on that page is making it forget whether it is supposed to be loading a comment form at the bottom. So now I need to figure out how to jog its memory. [Stupid. There’s so much hard coding on the film zone page, why not hard-code the comments form? So that’s what I’ve now done.]

For the next major release of single.php (the single-article template): a link to the Film Zone page if you’re looking at an article filed in the film category; and to the Book Zone page if you’re looking at a book review etc. That’s going to take a while, I think, because I’m going to need to work out how to tell WordPress that category 1, 5 and 7 and all their children should be associated with page A, category 2 and 4 with page B etc, and then tell it that if a post is filed in category 1, 2 and 7 then provide just one link to page A and a link to page B. It’s so frustrating when you know exactly what you need, but don’t know how to go about coding it.

All of which explains why there hasn’t been much content recently. I’d never make a living as a web designer.

Back to normal soon I hope.

  1. I’m assuming the “main” author has an author ID of 2, though this of course does not have to be the case. []

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.