__('سایدبار راست', 'nokhbe'),
'id' => 'right_sidebar',
'description' => __('سایدبار ستون سمت راست صفحه اصلی و مطالب', 'nokhbe'),
'class' => 'right-sidebar',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => ''
));
register_sidebars(3, array(
'name' => __('ناحیه %d فوتر', 'nokhbe'),
'id' => 'footer',
'class' => 'footer-widgets',
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
));
}
add_action('widgets_init', 'nokhbe_register_widgets');
// Register Top and Main menus
function nokhbe_register_menus()
{
register_nav_menus(array(
'top-menu' => __('منوی بالایی', 'nokhbe'),
'main-menu' => __('منوی اصلی', 'nokhbe')
));
}
add_action('init', 'nokhbe_register_menus');
// Filter the Excerpt to 20 words
function nokhbe_custom_excerpt_length($length)
{
return 20;
}
if(!is_admin()) {
add_filter('excerpt_length', 'nokhbe_custom_excerpt_length', 999);
}
// Filter the "read more" string
function nokhbe_excerpt_more($more)
{
return '...';
}
add_filter('excerpt_more', 'nokhbe_excerpt_more');
// Enqueue customizer Style
function nokhbe_customizer_styles()
{
$theme_defaults = nokhbe_sane_defaults();
?>
= 2 || $page >= 2 )
$title = "$title $sep " . sprintf( __( 'برگه ی %s', 'nokhbe' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'nokhbe_title_tag', 10, 2 );
// Using defaults for customizer
function nokhbe_sane_defaults () {
$defaults = array(
'nokhbe_rsidebar1_color' => '#d24d57',
'nokhbe_rsidebar2_color' => '#875f9a',
'nokhbe_rsidebar3_color' => '#26a65b',
'nokhbe_lsidebar_link' => '#',
'nokhbe_lsidebar_img' => get_template_directory_uri() . '/img/sidebar-ad.jpg'
);
return apply_filters( 'nokhbe_sane_defaults', $defaults );
}