224){ $str_width += 2; $i += 3; } else if(ord($str[$i] > 192)){ $str_width += 2; $i += 2; } else{ $str_width++; $i++; } }while($i 224){ $newword .= $str[$i].$str[$i+1].$str[$i+2]; $i = $i +3; $j =$j + 2; } //If the character is a symble else if(ord($str[$i] > 192)){ $newword .= $str[$i].$str[$i+1]; $i = $i + 2; $j = $j + 2; } //If the character is a alpha else{ $newword .= $str[$i]; $i++; $j++; } }while($j<$len); if($add){ return $newword.'...'; } else return $newword; } } function mytheme_addmenus() { register_nav_menus( array( 'main_nav' => 'The Main Menu', ) ); } add_action( 'init', 'mytheme_addmenus' ); function mytheme_nav() { if ( function_exists( 'wp_nav_menu' ) ) wp_nav_menu( 'menu=main_nav&fallback_cb=mytheme_nav_fallback' ); else mytheme_nav_fallback(); } function mytheme_nav_fallback() { wp_page_menu( 'show_home=Home' ); } if (function_exists('register_sidebar')) { register_sidebar( array( 'before_widget' => '
', 'after_widget' => '
', 'before_title' => '

', 'after_title' => '

', ) ); } function augMetro_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; global $commentcount; if(!$commentcount) { //初始化楼层计数器 $commentcount = 1; } ?>
#. | ,
0 && isset($_POST['theme_settings']) ){ $options = array ('SlideTitle1','SlideTitle2','SlideTitle3','SlideArticles1','SlideArticles2','SlideArticles3','SidebarAd1','SidebarAd2','PostBanner','Stretch1Title','Stretch1Content','Stretch2Title','Stretch2Content'); foreach ( $options as $opt ){ delete_option ( 'AMetro_'.$opt, $_POST[$opt] ); add_option ( 'AMetro_'.$opt, $_POST[$opt] ); } } if ($_POST['theme_settings']) echo '

Change Save !

'; add_theme_page('AMetro Setting', 'AMetro Setting', 'edit_themes', basename(__FILE__), 'AMetro_settings'); } function aMetro_settings(){?>

AMetro Theme Setting

Sliders Setting
SlideTitle 1
SlideArticles 1
SlideTitle 2
SlideArticles 2
SlideTitle 3
SlideArticles 3
Sidebar Setting
Box 1 Title
Box 1 Content
Box 2 Title
Box 2 Content
AD Setting
Sidebar AD 1
Best size:215x215
Sidebar AD 2
Best size:215x215
Post Banner
Best size:728x90