<?php
include("settings.php");
# Sidebar
if (function_exists('register_sidebar'))
{
register_sidebar(array(
'name' => 'Full Width Widget',
'before_widget' => '',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3><div class="box">',
));
register_sidebar(array(
'name' => 'Left Widget',
'before_widget' => '',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3><div class="box">',
));
register_sidebar(array(
'name' => 'Right Widget',
'before_widget' => '',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3><div class="box">',
));
register_sidebar(array(
'name' => 'Footer Widget',
'before_widget' => '',
'after_widget' => '</div></div>',
'before_title' => '<div class="left"><h3>',
'after_title' => '</h3><div class="box">',
));
}
# Limit Post
function the_content_limit($max_char, $more_link_text = '', $stripteaser = 0, $more_file = '') {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
$content = strip_tags($content);
if (strlen($_GET['p']) > 0) {
echo "";
echo $content;
echo " <a href='";
the_permalink();
echo "'>"."Okumaya devam et →</a>";
echo "";
}
else if ((strlen($content)>$max_char) && ($espacio = strpos($content, " ", $max_char ))) {
$content = substr($content, 0, $espacio);
$content = $content;
echo "";
echo $content;
echo " <a href='";
the_permalink();
echo "'>"."...</a>";
echo "";
}
else {
echo "";
echo $content;
echo " <a href='";
the_permalink();
echo "'>"."Okumaya devam et →</a>";
echo "";
}
}
# Retrieves the setting's value depending on 'key'.
function theme_settings($key) {
global $settings;
return $settings[$key];
}
?>