0 ) $pt_width = $purplepastels_theme_options['pt_width']; else $pt_width = 150; if( isset($purplepastels_theme_options['pt_height']) && $purplepastels_theme_options['pt_height'] > 0 ) $pt_height = $purplepastels_theme_options['pt_height']; else $pt_height = 150; if( isset($purplepastels_theme_options['pt_crop']) && $purplepastels_theme_options['pt_crop'] == 'hard' ) add_image_size( 'custom', $pt_width, $pt_height, true ); else add_image_size( 'custom', $pt_width, $pt_height ); // Set up custom post excerpt function purplepastels_excerpt_length() { global $purplepastels_theme_options; if( isset($purplepastels_theme_options['custom_excerpt']) && $purplepastels_theme_options['custom_excerpt'] > 0 ) return $purplepastels_theme_options['custom_excerpt']; else return 100; } add_filter('excerpt_length', 'purplepastels_excerpt_length'); } endif; add_action( 'after_setup_theme', 'purplepastels_theme_setup' ); // add custom menu support if( function_exists( 'register_nav_menu' ) && !function_exists( 'purplepastels_register_menus' )) : function purplepastels_register_menus() { register_nav_menu( 'toptabs', __( 'Top Tabs', 'purplepastels' ) ); } add_action( 'init', 'purplepastels_register_menus' ); endif; // Add accordian menu if( !isset($purplepastels_theme_options['accordian']) || $purplepastels_theme_options['accordian'] == 'yes' && !is_admin() ) add_action('init', 'etheme_init_accordian'); // Output stylesheet links if( !function_exists( 'purplepastels_stylesheets') ) : function purplepastels_stylesheets() { echo '' ."\n"; echo '' ."\n"; echo '' ."\n"; echo '' . "\n"; echo "\n"; } endif; add_action( 'wp_head', 'purplepastels_stylesheets' ); // Output designer meta tags if( !function_exists( 'purplepastels_designer') ) : function purplepastels_designer() { ?> 'Default Sidebar Upper', 'id' => 'default-upper', 'description' => __('Upper vertical sidebar','purplepastels'), 'before_widget' => '
' . '
'; $fields['url'] = '' . '
'; return $fields; } endif; add_filter('comment_form_default_fields','purplepastels_theme_comment_fields'); // Custom comment form arguments if( ! function_exists( 'purplepastels_theme_comment_form_args' ) ) : function purplepastels_theme_comment_form_args($user_identity, $post_id, $req) { global $purplepastels_theme_options; $args = array( 'comment_notes_before' => '', 'logged_in_as' => '', 'purplepastels' ), admin_url( 'profile.php' ), $user_identity, wp_logout_url( apply_filters( 'the_permalink', get_permalink( $post_id ) ) ) ), 'comment_field' => '', 'label_submit'=>'Submit Reply', 'purplepastels' ); if(!isset($purplepastels_theme_options['display_kses']) || $purplepastels_theme_options['display_kses'] == 'yes') $args['comment_notes_after'] = ''; else $args['comment_notes_after'] = ''; return $args; } endif; // Make sure we always have a post/page title if( !function_exists( 'purplepastels_correct_missing_title' ) ) : function purplepastels_correct_missing_title( $title ) { if( $title == '' ) $title = __('No Title', 'purplepastels'); return $title; } endif; add_filter( 'the_title', 'purplepastels_correct_missing_title' ); // Amend post password form if( !function_exists ('purplepastels_password_form') ) : function purplepastels_password_form() { global $post; $label = 'pwbox-'.(empty($post->ID) ? rand() : $post->ID); $output = '' . __('This post is password protected. To view it, please enter your password below:', 'purplepastels') . '
' . __('This is a password protected post.', 'purplepastels') . '
'; return $output; } endif; add_filter('the_excerpt','purplepastels_password_excerpt'); // Display a - b of x posts if( !function_exists( 'purplepastels_theme_postlist_info' ) ) : function purplepastels_theme_postlist_info($my_tot_pages, $paged, $found_posts) { if( $paged == '') $my_curr_page = 1; else $my_curr_page = $paged; $my_finish = $my_curr_page * get_option('posts_per_page'); if( $found_posts < $my_finish ) { $my_finish = $found_posts; $my_start = 1; } else $my_start = 1 + $my_finish - get_option('posts_per_page'); if( $my_finish > 1 ) { $format = __('Displaying %1$s - %2$s of %3$s entries.','purplepastels') ; printf( $format, $my_start, $my_finish, $found_posts); } else _e('Displaying 1 entry.','purplepastels'); } endif; // Ouput attachment image size if( !function_exists( 'purplepastels_attachment_image_size' ) ) : function purplepastels_attachment_image_size($excerpt) { global $post; if( wp_attachment_is_image() ) { $metadata = wp_get_attachment_metadata(); $excerpt .= '
|