Balance Tags to the_content Words Length

You better call it before returning, inside technig_content() so that it’s return value is always balanced. So, the last two lines of your function would become:

$content = str_replace(']]>', ']]>', $content);
$content = balanceTags( $content );
return $content;

Having said that, I don’t think it’s a good way of handling your output, since you don’t really know how the final HTML will end up to be.

In my opinion, you should either utilize the built-in read more tag for each article, in combination with the_content(), or provide custom excerpts and use the_excerpt(). Only then you’ll have total control of your end result.