</td> <td class="tdright"> <?php wp_nav_menu(array('theme_location' => 'global-menu', 'container_class' => 'tab-categories')); ?> </td> </tr> <tr> <td class="tdleft"><?php _e('Tags', MUTHEME_NAME); ?> </td> <td class="tdright"> <div class="tab-tags"> <?php wp_tag_cloud(array('unit' => 'px', 'smallest' => 12, 'largest' => 12, 'number' => mutheme_settings('tag_number'), 'format' => 'flat', 'orderby' => 'count', 'order' => 'DESC')); ?> </div> </td> </tr> </tbody> </table> </div> </div> </li> <?php } ?> </ul> </div> <div class="global-nav global-custom-nav left">
function mutheme_avatar($avatar) { if (!is_admin()) { $avatar = str_replace('src=', 'src="' . mutheme_cdn(mutheme_image('placeholder.png')) . '" data-original=', $avatar); } if (mutheme_settings('avatar') == 1) { $avatar = str_replace(array("www.gravatar.com", "0.gravatar.com", "1.gravatar.com", "2.gravatar.com"), "gravatar.duoshuo.com", $avatar); } return $avatar; }
<?php get_header(); ?> <div id="primary"> <div id="postlist"> <?php $full_content = mutheme_settings('full-content'); if (have_posts()) { while (have_posts()) { the_post(); $post_thumbnail = mutheme_thumbnail('index-thumbnail', 260, 260); $post_class = 'post'; if (!$full_content && $post_thumbnail["exist"]) { $post_class .= ' post-has-thumbnail'; } ?> <div id="post-<?php the_ID(); ?> " class="<?php echo $post_class; ?> "> <div class="post-header"> <h2 class="post-title"> <a href="<?php the_permalink(); ?> " title="<?php the_title();
/** * Theme body class */ function mutheme_body_class() { $extra_class = array(mutheme_settings('color')); if (mutheme_settings('full-content')) { $extra_class[] = 'full-content'; } $extra_class = implode(' ', $extra_class); body_class($extra_class); }
private function checkbox($key, $value, $text) { $real_val = mutheme_settings($key); ?> <label> <input type="checkbox" name="<?php echo MUTHEME_NAME . '_settings[' . $key . ']'; ?> " value="<?php echo $value; ?> " <?php if ($value == $real_val) { echo 'checked="checked"'; } ?> /> <?php echo $text; ?> </label> <?php }
* Disable symbol automatically converted to full ban */ remove_filter('the_content', 'wptexturize'); /** * Remove invalid information display at head tag */ remove_action('wp_head', 'rsd_link'); remove_action('wp_head', 'wlwmanifest_link'); remove_action('wp_head', 'wp_generator'); remove_action('wp_head', 'start_post_rel_link'); remove_action('wp_head', 'index_rel_link'); remove_action('wp_head', 'adjacent_posts_rel_link'); /** * Remove default wordpress widgets */ if (!mutheme_settings('register_widget')) { add_action('widgets_init', 'mutheme_unregister_default_widgets', 1); } function mutheme_unregister_default_widgets() { unregister_widget('WP_Widget_Pages'); unregister_widget('WP_Widget_Calendar'); unregister_widget('WP_Widget_Archives'); unregister_widget('WP_Widget_Links'); unregister_widget('WP_Widget_Meta'); unregister_widget('WP_Widget_Search'); unregister_widget('WP_Widget_Text'); unregister_widget('WP_Widget_Categories'); unregister_widget('WP_Widget_Recent_Posts'); unregister_widget('WP_Widget_Recent_Comments'); unregister_widget('WP_Widget_RSS');
/** * Theme file cdn setting * * @param array|string $obj * @param int $width * @param int $height * * @return string */ function mutheme_cdn($obj, $width = 0, $height = 0) { $url = ''; $need_crop = true; $cdn_type = mutheme_settings('cdn'); if (is_array($obj)) { $url = $obj['url']; $width = $obj['size'][0]; $height = $obj['size'][1]; $need_crop = $obj['crop']; } else { if (is_string($obj)) { $url = $obj; } } if ($cdn_type == 0) { //don't use any cdn services if ($need_crop) { $url = sprintf('%s?src=%s&w=%s&h=%s&zc=1&q=100', mutheme_file_url('timthumb.php'), urlencode($url), $width, $height); } } else { if ($cdn_type == 1) { //qiniu cdn service $url .= "?imageView/1/w/{$width}/h/{$height}/q/100"; } else { if ($cdn_type == 2) { //youpai cdn service $url .= "!{$width}x{$height}"; } } } return $url; }