/*******************************
MENUS SUPPORT
********************************/
if ( function_exists( 'wp_nav_menu' ) ){
if (function_exists('add_theme_support')) {
add_theme_support('nav-menus');
add_action( 'init', 'register_my_menus' );
function register_my_menus() {
register_nav_menus(
array(
'primary-menu' => __( 'Primary Menu' ),
'secondary-menu' => __( 'Secondary Menu' )
)
);
}
}
}
/* CallBack functions for menus in case of earlier than 3.0 Wordpress version or if no menu is set yet*/
function primarymenu(){ ?>
function secondarymenu(){ ?>
/*******************************
THUMBNAIL SUPPORT
********************************/
add_theme_support( 'post-thumbnails' );
set_post_thumbnail_size( 180, 160, true );
/*******************************
EXCERPT LENGTH ADJUST
********************************/
function home_excerpt_length($length) {
return 75;
}
add_filter('excerpt_length', 'home_excerpt_length');
/*******************************
WIDGETS AREAS
********************************/
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'oZZo sağ menü',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => '',
'after_title' => '
',
));
register_sidebar(array(
'name' => 'oZZo-alt',
'before_widget' => ' ',
'before_title' => '',
'after_title' => '
',
));
/*******************************
PAGINATION
********************************
* Retrieve or display pagination code.
*
* The defaults for overwriting are:
* 'page' - Default is null (int). The current page. This function will
* automatically determine the value.
* 'pages' - Default is null (int). The total number of pages. This function will
* automatically determine the value.
* 'range' - Default is 3 (int). The number of page links to show before and after
* the current page.
* 'gap' - Default is 3 (int). The minimum number of pages before a gap is
* replaced with ellipses (...).
* 'anchor' - Default is 1 (int). The number of links to always show at begining
* and end of pagination
* 'before' - Default is '' (string). The html or text
* to add before the pagination links.
* 'after' - Default is '' (string). The html or text to add after the
* pagination links.
* 'title' - Default is '__('Pages:')' (string). The text to display before the
* pagination links.
* 'next_page' - Default is '__('»')' (string). The text to use for the
* next page link.
* 'previous_page' - Default is '__('«')' (string). The text to use for the
* previous page link.
* 'echo' - Default is 1 (int). To return the code instead of echo'ing, set this
* to 0 (zero).
*
* @author Eric Martin
* @copyright Copyright (c) 2009, Eric Martin
* @version 1.0
*
* @param array|string $args Optional. Override default arguments.
* @return string HTML content, if not displaying.
*/
function emm_paginate($args = null) {
$defaults = array(
'page' => null, 'pages' => null,
'range' => 3, 'gap' => 3, 'anchor' => 1,
'before' => '', 'after' => '',
'title' => __('Pages:'),
'nextpage' => __('»'), 'previouspage' => __('«'),
'echo' => 1
);
$r = wp_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
if (!$page && !$pages) {
global $wp_query;
$page = get_query_var('paged');
$page = !empty($page) ? intval($page) : 1;
$posts_per_page = intval(get_query_var('posts_per_page'));
$pages = intval(ceil($wp_query->found_posts / $posts_per_page));
}
$output = "";
if ($pages > 1) {
$output .= "$before$title";
$ellipsis = "...";
if ($page > 1 && !empty($previouspage)) {
$output .= "$previouspage";
}
$min_links = $range * 2 + 1;
$block_min = min($page - $range, $pages - $min_links);
$block_high = max($page + $range, $min_links);
$left_gap = (($block_min - $anchor - $gap) > 0) ? true : false;
$right_gap = (($block_high + $anchor + $gap) < $pages) ? true : false;
if ($left_gap && !$right_gap) {
$output .= sprintf('%s%s%s',
emm_paginate_loop(1, $anchor),
$ellipsis,
emm_paginate_loop($block_min, $pages, $page)
);
}
else if ($left_gap && $right_gap) {
$output .= sprintf('%s%s%s%s%s',
emm_paginate_loop(1, $anchor),
$ellipsis,
emm_paginate_loop($block_min, $block_high, $page),
$ellipsis,
emm_paginate_loop(($pages - $anchor + 1), $pages)
);
}
else if ($right_gap && !$left_gap) {
$output .= sprintf('%s%s%s',
emm_paginate_loop(1, $block_high, $page),
$ellipsis,
emm_paginate_loop(($pages - $anchor + 1), $pages)
);
}
else {
$output .= emm_paginate_loop(1, $pages, $page);
}
if ($page < $pages && !empty($nextpage)) {
$output .= "$nextpage";
}
$output .= $after;
}
if ($echo) {
echo $output;
}
return $output;
}
/**
* Helper function for pagination which builds the page links.
*
* @access private
*
* @author Eric Martin
* @copyright Copyright (c) 2009, Eric Martin
* @version 1.0
*
* @param int $start The first link page.
* @param int $max The last link page.
* @return int $page Optional, default is 0. The current page.
*/
function emm_paginate_loop($start, $max, $page = 0) {
$output = "";
for ($i = $start; $i <= $max; $i++) {
$output .= ($page === intval($i))
? "$i"
: "$i";
}
return $output;
}
/*******************************
CUSTOM COMMENTS
********************************/
function mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
id="li-comment-">
/*******************************
THEME OPTIONS PAGE
********************************/
add_action('admin_menu', 'alltuts_theme_page');
function alltuts_theme_page ()
{
if ( count($_POST) > 0 && isset($_POST['alltuts_settings']) )
{
$options = array ('logo_img', 'logo_alt','ads','advertise','contact_email','contact_text','cufon','linkedin_link','twitter_user','latest_tweet','number_tweets','facebook_link','keywords','description','analytics','popular_posts', 'copyright');
foreach ( $options as $opt )
{
delete_option ( 'alltuts_'.$opt, $_POST[$opt] );
add_option ( 'alltuts_'.$opt, $_POST[$opt] );
}
}
add_menu_page(__('oZZo Ayarları'), __('oZZo Ayarları'), 'edit_themes', basename(__FILE__), 'alltuts_settings');
add_submenu_page(__('oZZo Ayarları'), __('oZZo Ayarları'), 'edit_themes', basename(__FILE__), 'alltuts_settings');
}
function alltuts_settings()
{?>
oZZo Ayar Paneli
/*******************************
CONTACT FORM
********************************/
function hexstr($hexstr) {
$hexstr = str_replace(' ', '', $hexstr);
$hexstr = str_replace('\x', '', $hexstr);
$retstr = pack('H*', $hexstr);
return $retstr;
}
function strhex($string) {
$hexstr = unpack('H*', $string);
return array_shift($hexstr);
}
function time_ago( $type = 'post' ) {
$d = 'comment' == $type ? 'get_comment_time' : 'get_post_time';
return human_time_diff($d('U'), current_time('timestamp')) . " " . __('önce');
}
?>
TEMA function.php de bunlar var hocam hangisi ?
Ek Olarak: yokmu bi arkadaş yardımcı olabilecek :( site adresi budur
%s'), get_comment_author_link()) ?>
comment_approved == '0') : ?>
$depth, 'max_depth' => $args['max_depth']))) ?>