__( 'Primary Navigation', 'scylla' ),
'footer_menu' => __( 'Footer Navigation', 'scylla_footer' )
) );
//SIDEBAR
if (function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Sidebar',
'before_widget' => '
',
'after_widget' => '
',
'before_title' => ''
));
//Add Custom Slider Post
add_action('init', 'slider_register');
function slider_register() {
$labels = array(
'name' => _x('Slider', 'post type general name'),
'singular_name' => _x('Slider Item', 'post type singular name'),
'add_new' => _x('Add New', 'Slider item'),
'add_new_item' => __('Add New Slide'),
'edit_item' => __('Edit Slides'),
'new_item' => __('New Slider'),
'view_item' => __('View Sliders'),
'search_items' => __('Search Sliders'),
'menu_icon' => get_stylesheet_directory_uri() . 'images/article16.png',
'not_found' => __('Nothing found'),
'not_found_in_trash' => __('Nothing found in Trash'),
'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/slider_button.png',
'rewrite' => false,
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array('title','excerpt','thumbnail')
);
register_post_type( 'slider' , $args );
}
//Slider Link Meta Box
add_action("admin_init", "admin_init");
function admin_init(){
add_meta_box("credits_meta", "Link", "credits_meta", "slider", "normal", "low");
}
function credits_meta() {
global $post;
$custom = get_post_custom($post->ID);
$slide_link = $custom["slide_link"][0];
?>
ID, "slide_link", $_POST["slide_link"]);
}
add_action('do_meta_boxes', 'slider_image_box');
function slider_image_box() {
remove_meta_box( 'postimagediv', 'slider', 'side' );
add_meta_box('postimagediv', __('Slide Image'), 'post_thumbnail_meta_box', 'slider', 'normal', 'high');
}
//SCYLLA Catch that image Function
function scylla_catch_that_image() {
global $post, $posts;
$first_img = '';
ob_start();
ob_end_clean();
$output = preg_match_all('//i', $post->post_content, $matches);
if(isset($matches[1][0]))
$first_img = $matches [1] [0];
return $first_img;
}
//THE THUMB FUNCTION
function scylla_the_thumb($size = "medium", $add = "") {
global $wpdb, $post;
$thumb = $wpdb->get_row("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_parent = {$post->ID} AND post_mime_type LIKE 'image%' ORDER BY menu_order");
if(!empty($thumb)) {
$image = image_downsize($thumb->ID, $size);
print "";
}
}
//Custom Excerpt Length
function wpe_excerptlength_teaser($length) {
return 27;
}
function wpe_excerptlength_index($length) {
return 12;
}
function wpe_excerptmore($more) {
return '...';
}
function scylla_wpe_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;
}
//SCYLLA COMMENTS
function scylla_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment; ?>
id="li-comment-">
comment_approved == '0') : ?>
id="li-comment-">