Archive for "April, 2008"

Just a few words…

Article, Miscellaneous Apr 27, 2008 2 Comments

Finally I got the new design ready. A dark color scheme this time, because I really like it how dark backgrounds play together with vibrant colors. I wrote some nice wordpress plug-ins to make my life easier and switched from mootools to jQuery.

I’m more than ever fascinated by the web and while i did struggle the last time I wanted to post on a regular basis, I will now try it again and hopefully succeed ;)

Since most of my visitors seem to be from non-German speaking countries, I use this as an excuse to polish my English, since its getting worse every day. So the navigation, the blog and my tutorials section shall be written in English from this day on; rest of the site will remain German… at least for now.

How to modify your WordPress RSS Feed

Tutorials, Wordpress Tutorial Apr 27, 2008 46 Comments

I for myself really enjoy using WordPress as a Content Management System, since most of the time its really easy to adapt to my needs. I usually use the different categories on my sites to display the various sections of the sites. For example, kriesi.at uses the category “tutorials” to feed the resources page and the “portfolio” category to feed my online portfolio.

This is easily accomplished by using the query_posts() function of WordPress which i won’t discuss in detail since the documentations are pretty comprehensive.

The problem I recently encountered is that the WordPress generated rss feed must be modified as well, otherwise it will display every post in each category. A user subscribing to my blog feed doesn’t want to be bothered with portfolio entrys, so I searched for a way to exclude categories from the main feed. There are basically two solutions I could find:

  1. Exclude the Categories via URL
  2. Exclude the Categories through using a small function

Both ways are really simple:

If you want to exclude a category you first have to know the ID of course. In WordPress versions prior to 2.5 you could just get it in your admin panels “manage” -> “categories” section. Post 2.5 versions do not display the category ID anymore but you can get it by hovering over the category name and extracting it from the link URL. Its the cat_ID attribute.

Say you want to exclude category 20 you just append ?cat=-20 to your feed url.

Example:

  • normal feed: http://www.kriesi.at/feed
  • modified feed: http://www.kriesi.at/feed?cat=-20
  • want to exclude more categories: http://www.kriesi.at/feed?cat=-20&cat=-21&cat=-22

Well these URLs are not what i would consider beautiful so you might use a service like feedburner to create a nice looking feed out of it. But beware, feedburner expects a slightly different syntax; insted of using ampersands you have to use commas:

So if you want to exclude a WordPress category from the Feedburner feed do it this way:

http://www.kriesi.at/feed?cat=-20,-21,-22

If you dont’t like this way of excluding you can use a small function instead. Just add the following code anywhere to your templates functions.php:

function my_cat_exclude($query) {
    if ($query->is_feed) {
        $query->set('cat','-20,-21,-22');
    }
    return $query;
}

add_filter('pre_get_posts','my_cat_exclude');

This function will strip the categories you define out of your RSS Feed without the need of adjusting your url.
A clean and simple way but not as flexible as using URLs if you want to provide more than one feed.

Hope this helps you if you ever need to modify your feed.

My main navigation

Article, Javascript, Miscellaneous Apr 15, 2008 3 Comments

Since the article Navigation Menus: Trends and Examples was released on Smashing Magazine in February, I got quite a number of mails from fellow designers, who asked how to accomplish the sliding effect of my main menu. Even enough mails, that I thought about writing a little tutorial, but I must admit I am to lazy at the moment =)

mootools.netAnyways, here are some tips for creating a similar menu: Head over to http://mootools.net and get a little familiar with this extraordinary Javascript Framework. In the demo section of the page, you will find a sub-menu entry called Fx-Elements which contains everything you need to build a so called “kwick menu”. By analyzing the HTML, CSS and Javascript you should be able to accomplish similar menus in almost no time.

jquery.comThose who use Jquery (which is my prefered Framework atm, because of the steeper learning curve) can use the plugin, recently written by Jeremy Martin at jMars blog. I haven’t tested it for now but looking at the preview examples, it seems to work pretty well.

Hope I could help those of you who seek aid in creating a similar menu.

Update: I am using jQuery now, as well as jMars Kwicks plugin and it works like a charm ;)

Featured again…

Article, Miscellaneous Apr 10, 2008 Comments Off

Well, as I recently checked my Google analytics account, I saw a heavy increase of site impressions.. from Japan!

As i checked the incoming links it turned out that I was featured again, this time by the Japanese monthly magazine, “Web Designing“. It seems like someone over there liked my design, as well as the style of my CSS (at least i hope, could as well be a damning review, I’ll probably never find out)

All i could find out was: the article written by Miki Ofuji includes a CSS and XHTML analysis.
Well, enough with the bragging, just wanted to say hello to my Japanese Visitors ;)
If you like, leave me a comment and tell me what Mr. Ofuji liked or disliked…

PS: sorry about my poor English, it’s been a while since I last wrote a non-German article ;)