__( 'Primary navigation', 'blogostrap' ) ) );
} endif;
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class($classes, $item){
if( in_array('current-menu-item', $classes) ){
$classes[] = 'active ';
}
return $classes;
}
####################################################################
add_theme_support( 'title-tag' );
add_theme_support( 'custom-background' ); /*requires WP v >= 3.4 */
add_theme_support( 'custom-header' );
add_theme_support( 'post-thumbnails' );
add_editor_style();
// Add Automatic Feed Links
add_theme_support( 'automatic-feed-links' );
// Localization Support
add_action( 'after_setup_theme', 'ns_theme_setup_lang' );
function ns_theme_setup_lang(){
load_theme_textdomain( 'blogostrap' );
}
####################################################################
function ns_explode_mail_contact($mailn5){
$ns_mail_print = '';
$ns_mailexpuser = explode("@", $mailn5);
$ns_mailexpprov = explode(".", $ns_mailexpuser[1]);
$ns_mail_print .= $ns_mailexpuser[0];
$ns_mail_print .= '[at]';
$ns_mail_print .= $ns_mailexpprov[0];
$ns_mail_print .= '[dot]';
$ns_mail_print .= $ns_mailexpprov[1];
return $ns_mail_print;
}
####################################################################
function ns_blogo_comm( $comment, $args, $depth ) {
$GLOBALS['comment'] = $comment;
?>
id="li-comment-">
Posted by: | 'li-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'] ) ) ); ?> to
';
$message = $_POST['ns_contact_message'] . "\r\n";
$message .= 'Phone number: '.$_POST['ns_contact_phone'];
wp_mail($ns_mailadmin_to, 'New contact from WebSite', $message, $headers);
echo 'emailsent';
die();
} else {
echo 'emailnotsent';
die();
}
}
####################################################################
add_action( 'wp_ajax_nopriv_ns_addpost_love', 'ns_addpost_love' );
add_action( 'wp_ajax_post_ns_addpost_love', 'ns_addpost_love' );
function ns_addpost_love() {
$love = get_post_meta( $_POST['post_id'], 'post_love', true );
$love++;
update_post_meta( $_POST['post_id'], 'post_love', $love );
setcookie('ns_first_love_button'.$_POST['post_id'] , 1, time() + (86400), "/"); // (86400 * 30) 86400 = 1 day
echo $love;
die();
}
####################################################################
add_action( 'widgets_init', 'blogostrap_widgets_init' );
function blogostrap_widgets_init() {
register_sidebar( array(
'name' => __( 'Sidebar', 'blogostrap' ),
'id' => 'sidebar-widget',
'description' => __( 'Sidebar', 'blogostrap' ),
'before_widget' => '',
'after_widget' => '',
'before_title' => '',
'after_title' => '
',
));
}
####################################################################
function ns_inc_theme_option($name_file){
$options = get_option('ns_general_options');
$options_social = get_option('ns_general_options');
$options_maintenance = get_option('ns_general_options');
require_once( NS_THEME_OPTIONS_PATH.'/'.$name_file);
}
function ns_inc_theme_option_setup($name_file){
require_once( NS_INC_PATH.'/theme-option/'.$name_file);
}
?>