示例#1
0
文件: header.php 项目: nsdown/kunkka
</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">
示例#2
0
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;
}
示例#3
0
文件: index.php 项目: nsdown/kunkka
<?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();
示例#4
0
/**
 * 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);
}
示例#5
0
    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 
    }
示例#6
0
 * 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');
示例#7
0
/**
 * 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&#63;src=%s&#38;w=%s&#38;h=%s&#38;zc=1&#38;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;
}