'Sidebar', 'id' => 'sidebar', 'description' => 'Sidebar', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => 'Index Widget', 'id' => 'indexwidget', 'description' => 'Index Widget', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => 'Footer 1', 'id' => 'footer1', 'description' => 'Footer 1', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => 'Footer 2', 'id' => 'footer2', 'description' => 'Footer 2', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => 'Footer 3', 'id' => 'footer3', 'description' => 'Footer 3', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); register_sidebar( array( 'name' => 'Footer 4', 'id' => 'footer4', 'description' => 'Footer 4', 'before_widget' => '', 'after_widget' => '', 'before_title' => '

', 'after_title' => '

', ) ); } add_action( 'widgets_init', 'grid_widgets_init' ); # theme supports add_theme_support( 'automatic-feed-links' ); add_editor_style(); add_theme_support( 'post-thumbnails' ); set_post_thumbnail_size( 150, 150 ); // default Post Thumbnail dimensions add_image_size( 'index-thumb', 180, 9999 ); //180 pixels wide (and unlimited height) add_image_size( 'slider-thumb', 440, 9999, true ); //(cropped) // Add Custom Header define('HEADER_TEXTCOLOR', ''); define('HEADER_IMAGE_WIDTH', 1600); define('HEADER_IMAGE_HEIGHT', 150); define('NO_HEADER_TEXT', true ); function grid_header_style() { ?> $postid, 'post_type' => 'attachment', 'numberposts' => 1, 'post_mime_type' => 'image',))) foreach($images as $image) { $attachment=wp_get_attachment_image_src($image->ID, $size); ?> /> 'Primary Menu' ) ); }; if (function_exists('register_nav_menus')) add_action( 'init', 'grid_register_main_menus' ); # custom background add_custom_background(); function grid_trim_excerpt($text) { return rtrim($text,'[...]'); } add_filter('get_the_excerpt', 'grid_trim_excerpt'); add_filter('excerpt_length', 'my_excerpt_length'); function my_excerpt_length($length) { return 57; // Or whatever you want the length to be. } //Tweak Comments function grid_comment( $comment, $args, $depth ) { $GLOBALS['comment'] = $comment; switch ( $comment->comment_type ) : case '' : ?>
  • id="li-comment-">
    %s', get_comment_author_link() ) ); ?>
    comment_approved == '0' ) : ?> Your comment is awaiting moderation
    $depth, 'max_depth' => $args['max_depth'] ) ) ); ?>
  • Pingback:

    'my-meta-box', 'title' => 'Custom meta box', 'page' => 'post', 'context' => 'normal', 'priority' => 'high', 'fields' => array( array( 'name' => 'Video', 'desc' => 'Enter iframe src code', 'id' => $prefix . 'video', 'type' => 'textarea', 'std' => '' ) ) ); add_action('admin_menu', 'mytheme_add_box'); // Add meta box function mytheme_add_box() { global $meta_box; add_meta_box($meta_box['id'], $meta_box['title'], 'mytheme_show_box', $meta_box['page'], $meta_box['context'], $meta_box['priority']); } // Callback function to show fields in meta box function mytheme_show_box() { global $meta_box, $post; // Use nonce for verification echo ''; echo ''; foreach ($meta_box['fields'] as $field) { // get current post meta data $meta = get_post_meta($post->ID, $field['id'], true); echo '', '', ''; } echo '
    '; switch ($field['type']) { case 'text': echo '', '
    ', $field['desc']; break; case 'textarea': echo '', '
    ', $field['desc']; break; } echo '
    ', '
    '; } add_action('save_post', 'mytheme_save_data'); // Save data from meta box function mytheme_save_data($post_id) { global $meta_box; // verify nonce if (!wp_verify_nonce($_POST['mytheme_meta_box_nonce'], basename(__FILE__))) { return $post_id; } // check autosave if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) { return $post_id; } // check permissions if ('page' == $_POST['post_type']) { if (!current_user_can('edit_page', $post_id)) { return $post_id; } } elseif (!current_user_can('edit_post', $post_id)) { return $post_id; } foreach ($meta_box['fields'] as $field) { $old = get_post_meta($post_id, $field['id'], true); $new = $_POST[$field['id']]; if ($new && $new != $old) { update_post_meta($post_id, $field['id'], $new); } elseif ('' == $new && $old) { delete_post_meta($post_id, $field['id'], $old); } } } // END post metaboxes - video //Add Custom Slider Post add_action('init', 'mass_slider_register'); function mass_slider_register() { $labels = array( 'name' => 'Slider', 'post type general name', 'singular_name' => 'Slider Item', 'post type singular name', 'add_new' => 'Add New', 'Slider item', 'add_new_item' => 'Add New Slide', 'mass', 'edit_item' => 'Edit Slides', 'mass', 'new_item' => 'New Slider', 'mass', 'view_item' => 'View Sliders', 'mass', 'search_items' => 'Search Sliders', 'mass', 'menu_icon' => get_stylesheet_directory_uri() . 'images/article16.png', 'not_found' => 'Nothing found', 'mass', 'not_found_in_trash' => 'Nothing found in Trash', 'mass', '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_meta_box_cb' => 'mass_add_meta' ); register_post_type( 'slider' , $args ); } //Slider Link Meta Box add_action("admin_init", "mass_add_meta"); function mass_add_meta(){ add_meta_box("mass_credits_meta", "Link", "mass_credits_meta", "slider", "normal", "low"); } function mass_credits_meta( $post ) { // Use nonce for verification $massdata = get_post_meta($post->ID, 'mass_slide_link', TRUE); wp_nonce_field( 'mass_meta_box_nonce', 'meta_box_nonce' ); // The actual fields for data entry echo ''; } //Save Slider Link Value add_action('save_post', 'mass_save_details'); function mass_save_details($post_id){ if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) return; if( !isset( $_POST['meta_box_nonce'] ) || !wp_verify_nonce( $_POST['meta_box_nonce'], 'mass_meta_box_nonce' ) ) return; if ( !current_user_can( 'edit_post', $post_id ) ) return; $massdata = esc_url( $_POST['mass_sldurl'] ); update_post_meta($post_id, 'mass_slide_link', $massdata); return $massdata; } add_action('do_meta_boxes', 'mass_slider_image_box'); function mass_slider_image_box() { remove_meta_box( 'postimagediv', 'slider', 'side' ); add_meta_box('postimagediv', __('Slide Image', 'mass'), 'post_thumbnail_meta_box', 'slider', 'normal', 'high'); } // get the first image of the post Function function mass_get_images($overrides = '', $exclude_thumbnail = false) { return get_posts(wp_parse_args($overrides, array( 'numberposts' => -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' ))); } ?>