WORDPRESS: Changed extension hack by function call in custom theme