Warning: you are using an old version of
Internet Explorer. Please upgrade to IE 8 or later
for maximum site compatibility!');
}
}
function ttw_multi_col($content){
// layout content into two colums, multiple rows using to split for 2 col template
// derived from: http://www.robsearles.com/2009/07/05/wordpress-multiple-content-columns/
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
// the first "more" is converted to a span with ID
$columns = preg_split('/(<\/span>)|()<\/p>/', $content);
$col_count = count($columns);
if($col_count > 1) {
for($i=0; $i < $col_count; $i++) {
// check to see if there is a final , if not add it
if(!preg_match('/<\/p>\s?$/', $columns[$i]) ) {
$columns[$i] .= '';
}
// check to see if there is an appending , if there is, remove
$columns[$i] = preg_replace('/^\s?<\/p>/', '', $columns[$i]);
// now add the div wrapper
if ((int)($i % 2) == 0) $coldiv = 'left'; else $coldiv = 'right';
if ($coldiv == 'right' && ($i+1) < $col_count) {
$break_cols ='';
} else {
$break_cols = '';
}
$columns[$i] = '
'.$columns[$i] .'
' . $break_cols ;
}
$content = join($columns, "\n").'';
}
else {
// this page does not have dynamic columns
$content = wpautop($content);
}
// remove any left over empty
tags
$content = str_replace('
', '', $content);
return $content;
}
define('TTW_DEBUG',false);
function ttw_debug($msg) {
if (TTW_DEBUG) {
echo("\n*******************>$msg<******************* \n");
}
}
?>