__( 'Primary Navigation', 'zenon' ),
'footer' => __( 'Footer Navigation', 'zenon' )
) );
//Include CSS
function znn_customstyle() { ?>
add_data( 'znn_ie', 'conditional', 'IE 8' );
wp_enqueue_style( 'znn_ie' );
}
}
add_action('wp_enqueue_scripts', 'znn_ie_css');
function znn_other_css() {
if ( !is_admin() ) {
wp_enqueue_style('customfont',get_template_directory_uri().'/fonts/'.$zn_fonts = of_get_option('font_select', 'yanone_kaffeesatz' ).'.css');
if(of_get_option('disslight_checkbox') == "0"){ ?>
-1,
'post_parent' => get_the_ID(),
'post_type' => 'attachment',
'post_mime_type' => 'image',
'order' => 'ASC',
'exclude' => $exclude_thumbnail ? array(get_post_thumbnail_id()) : array(),
'orderby' => 'menu_order ID'
)));
}
// Change what's hidden by default
add_filter('default_hidden_meta_boxes', 'znn_hidden_meta_boxes', 10, 2);
function znn_hidden_meta_boxes($hidden, $screen) {
if ( 'post' == $screen->base || 'page' == $screen->base || 'slider' == $screen->base )
$hidden = array('slugdiv', 'trackbacksdiv', 'commentstatusdiv', 'commentsdiv', 'authordiv', 'revisionsdiv');
// removed 'postcustom',
return $hidden;
}
//Custom Excerpt Length
function znn_excerptlength_teaser($length) {
return 33;
}
function znn_excerptlength_index($length) {
return 12;
}
function znn_excerptmore($more) {
return '...';
}
function znn_excerpt($length_callback='', $more_callback='') {
global $post;
if(function_exists($length_callback)){
add_filter('excerpt_length', $length_callback);
}
if(function_exists($more_callback)){
add_filter('excerpt_more', $more_callback);
}
$output = get_the_excerpt();
$output = apply_filters('wptexturize', $output);
$output = apply_filters('convert_chars', $output);
$output = '
'.$output.'
';
echo $output;
}
//SIDEBAR
function znn_widgets_init(){
register_sidebar(array(
'name' => __('Right Sidebar', 'zenon'),
'id' => 'sidebar',
'description' => __('Right Sidebar', 'zenon'),
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
));
register_sidebar(array(
'name' => __('Footer Widgets', 'zenon'),
'id' => 'foot_sidebar',
'description' => __('Widget Area for the Footer', 'zenon'),
'before_widget' => '',
'after_widget' => '
',
'before_title' => ''
));
}
add_action( 'widgets_init', 'znn_widgets_init' );
//ZENON COMMENTS
function znn_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
id="li-comment-">
comment_approved == '0') : ?>
id="li-comment-">
__('Slider', 'zenon'),
'singular_name' => __('Slider Item', 'zenon'),
'add_new' => __('Add New', 'zenon'),
'add_new_item' => __('Add New Slide', 'zenon'),
'edit_item' => __('Edit Slides', 'zenon'),
'new_item' => __('New Slider', 'zenon'),
'view_item' => __('View Sliders', 'zenon'),
'search_items' => __('Search Sliders', 'zenon'),
'menu_icon' => get_stylesheet_directory_uri() . 'images/article16.png',
'not_found' => __('Nothing found', 'zenon'),
'not_found_in_trash' => __('Nothing found in Trash', 'zenon'),
'parent_item_colon' => ''
);
$args = array(
'labels' => $labels,
'public' => true,
'exclude_from_search' => true,
'publicly_queryable' => true,
'show_ui' => true,
'query_var' => true,
'menu_icon' => get_stylesheet_directory_uri() . '/images/slides.png',
'rewrite' => false,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','excerpt','thumbnail'),
'register_meta_box_cb' => 'znn_add_meta'
);
register_post_type( 'slider' , $args );
}
//Slider Link Meta Box
add_action("admin_init", "znn_add_meta");
function znn_add_meta(){
add_meta_box("znn_credits_meta", "Link", "znn_credits_meta", "slider", "normal", "low");
add_meta_box("znn_da_title_meta", "Danish Title", "znn_da_title_meta", "slider", "normal", "low");
add_meta_box("znn_da_link_meta", "Danish Link", "znn_da_link_meta", "slider", "normal", "low");
add_meta_box("znn_da_text_meta", "Danish Excerpt", "znn_da_text_meta", "slider", "normal", "low");
}
function znn_credits_meta( $post ) {
// Use nonce for verification
$znndata = get_post_meta($post->ID, 'znn_slide_link', TRUE);
wp_nonce_field( 'znn_meta_box_nonce', 'meta_box_nonce' );
// The actual fields for data entry
echo '';
}
//Save Slider Link Value
add_action('save_post', 'znn_save_details');
function znn_save_details($post_id){
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'znn_meta_box_nonce' ) ) return;
if ( !current_user_can( 'edit_post', $post_id ) )
return;
$znndata = esc_url( $_POST['znn_sldurl'] );
update_post_meta($post_id, 'znn_slide_link', $znndata);
return $znndata;
}
function znn_da_title_meta( $post ) {
// Use nonce for verification
$znntitle = get_post_meta($post->ID, 'znn_da_title', TRUE);
wp_nonce_field( 'znn_meta_box_nonce', 'meta_box_nonce' );
// The actual fields for data entry
echo '';
}
//Save Slider Link Value
add_action('save_post', 'znn_title_save_details');
function znn_title_save_details($post_id){
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'znn_meta_box_nonce' ) ) return;
if ( !current_user_can( 'edit_post', $post_id ) )
return;
$znntitle = ( $_POST['znn_da_title'] );
update_post_meta($post_id, 'znn_da_title', $znntitle);
return $znntitle;
}
function znn_da_link_meta( $post ) {
// Use nonce for verification
$znndalink = get_post_meta($post->ID, 'znn_da_link', TRUE);
wp_nonce_field( 'znn_meta_box_nonce', 'meta_box_nonce' );
// The actual fields for data entry
echo '';
}
//Save Slider Link Value
add_action('save_post', 'znn_da_link_save_details');
function znn_da_link_save_details($post_id){
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'znn_meta_box_nonce' ) ) return;
if ( !current_user_can( 'edit_post', $post_id ) )
return;
$znndalink = esc_url( $_POST['znn_da_link'] );
update_post_meta($post_id, 'znn_da_link', $znndalink);
return $znndalink;
}
function znn_da_text_meta( $post ) {
// Use nonce for verification
$znndatext = get_post_meta($post->ID, 'znn_da_text', TRUE);
wp_nonce_field( 'znn_meta_box_nonce', 'meta_box_nonce' );
// The actual fields for data entry
echo '';
}
//Save Slider Link Value
add_action('save_post', 'znn_da_text_save_details');
function znn_da_text_save_details($post_id){
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE )
return;
if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'znn_meta_box_nonce' ) ) return;
if ( !current_user_can( 'edit_post', $post_id ) )
return;
$znndatext = ( $_POST['znn_da_text'] );
update_post_meta($post_id, 'znn_da_text', $znndatext);
return $znndatext;
}
add_action('do_meta_boxes', 'znn_slider_image_box');
function znn_slider_image_box() {
remove_meta_box( 'postimagediv', 'slider', 'side' );
add_meta_box('postimagediv', __('Slide Image', 'zenon'), 'post_thumbnail_meta_box', 'slider', 'normal', 'high');
}
/*
* Loads the Options Panel
*/
/* Set the file path based on whether we're in a child theme or parent theme */
if ( STYLESHEETPATH == TEMPLATEPATH ) {
define('OPTIONS_FRAMEWORK_URL', TEMPLATEPATH . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_template_directory_uri() . '/admin/');
} else {
define('OPTIONS_FRAMEWORK_URL', STYLESHEETPATH . '/admin/');
define('OPTIONS_FRAMEWORK_DIRECTORY', get_stylesheet_directory_uri() . '/admin/');
}
require_once (OPTIONS_FRAMEWORK_URL . 'options-framework.php');
include(TEMPLATEPATH . '/lib/script/pagination.php');
include(TEMPLATEPATH . '/lib/includes/shortcodes.php');
include(TEMPLATEPATH . '/lib/includes/widgets.php');
?>