Tips


Sep 05

Tips

[Tip] Check if category has children

If you looking forward checking if a certain category has children or not , simply do this

	$categories = get_categories( "parent=$cat_id&hide_empty=0" );
	if(empty($categories)) {
		// what if has no children
	} else {
		// what if has children
	}

don’t forget replacing $cat_id with the category id you want to check .

Sep 02

Tips

[Quick Tip] target=”_blank” fix for xHTML1.0 strict

Maybe you faced this or you may face the problem of using target = “_blank” while working with xHtml1.0 strict doctype as the W3 validator won’t validate because target = “_blank” is not support .. so replace target = “_blank” with this javascript code

onclick="return ! window.open(this.href);"

Copyright © 2012 Banhawi & web design egypt