Archive for January, 2010

This weekend i needed to extend wordpress basic functionality. I was using the get_the_category function, wich returns an array of objects, one object for each category assigned to the post. What i needed was to display only categories, belonging to exactly one parent.

I search the internet, but surprisingly i didn’t find what i was looking for. So i had to extend wordpress get_the_category function:

function get_the_category_extend($postID, $parent_of=-1){
$out = array();
foreach((get_the_category($postID)) as $category) {
if($parent_of!=-1){
if($category->category_parent == $parent_of){
$out[] = $category;
}
}
}
return $out;
}

It gets post ID and a ID of a parent. It returns only child categories. Yes, its very simple :)

You copy this function into functions.php, located in your theme directory. You can upgrade this function with whatever you need, if your nice you can even post it here…

In December i was writing about Google’s speed tracker. Today, i had to test some web page performance, so, i tried googles speed tracker – and the results was not so informative as i wished to be. I had to get more data on what is slowing down the page.

So I went on a hunt for the best web page performance tool, wich would give me the information i needed to improve speed of web page.

After some hours of searching, i found the tool i was looking for – http://www.webpagetest.org, and ofcourse i share it with you. With this tool i could easily spot problems wich were slowing down the web page. Thats all i need :)

Here are some images, just to see what are the results…

Content breakdown

Picture 1 of 6

Continue Reading

© Copyright Webspices.net. All Rights Reserved.