_x('Slides', 'post type general name'), 'singular_name' => _x('Slide', 'post type singular name'), 'add_new' => _x('Add New', 'slide'), 'add_new_item' => __('Add New Slide'), 'edit_item' => __('Edit Slide'), 'new_item' => __('New Slide'), 'view_item' => __('View Slide'), 'search_items' => __('Search Slides'), 'not_found' => __('No slides found'), 'not_found_in_trash' => __('No slides found in Trash'), 'parent_item_colon' => '', 'menu_name' => 'Slides' ); $args = array( 'labels' => $labels, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'rewrite' => true, 'capability_type' => 'post', 'has_archive' => false, 'hierarchical' => false, 'menu_position' => 20, 'supports' => array('title','editor','custom-fields','thumbnail') ); register_post_type('slide',$args); } // Load javascripts and css files if(!is_admin()){ add_action('wp_print_scripts', 'js_load_js'); function js_load_js(){ wp_enqueue_script('jquery'); wp_enqueue_script('jquerySliderJs', JS_URL.'/js/jquerySlider.min.js'); } add_action('wp_print_styles', 'js_load_css'); function js_load_css(){ wp_enqueue_style('jquerySliderCss', JS_URL.'/css/jquery-slider.css'); } add_action('wp_head', 'js_head_code'); function js_head_code(){ $out = ""; echo $out; } } function jquery_slider(){ global $post; $qry = new WP_Query('post_type=slide&showposts=-1'); if($qry->have_posts()): $out = '
'; endif; wp_reset_postdata(); return $out; } add_shortcode('jQuery Slider', 'jquery_slider'); add_theme_support('post-thumbnails');