Пример #1
0
</title>
<?php 
    if (is_home()) {
        if (get_option('wpyou_homepage_description')) {
            $homepage_description = get_option('wpyou_homepage_description');
        }
        if (get_option('wpyou_homepage_keywords')) {
            $homepage_keywords = get_option('wpyou_homepage_keywords');
        }
        $description = htmlentities(strip_tags(trim($homepage_description)), ENT_QUOTES, 'UTF-8');
        $keywords = htmlentities(strip_tags(trim($homepage_keywords)), ENT_QUOTES, 'UTF-8');
    } elseif (is_single()) {
        if (get_post_meta($post->ID, "description", $single = true) != "") {
            $description = get_post_meta($post->ID, "description", $single = true);
        } else {
            $description = wpyou_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 130, "...");
        }
        if (get_post_meta($post->ID, "keywords", $single = true) != "") {
            $keywords = get_post_meta($post->ID, "keywords", $single = true);
        } else {
            $tags = wp_get_post_tags($post->ID);
            $count = count($tags);
            $i = 1;
            foreach ($tags as $tag) {
                if ($i == $count) {
                    $keywords = $keywords . $tag->name;
                } else {
                    $keywords = $keywords . $tag->name . ",";
                }
            }
        }
Пример #2
0
" ><img src="<?php 
            echo catch_post_image();
            ?>
" title="<?php 
            the_title();
            ?>
" alt="<?php 
            the_title();
            ?>
" /></a>
                                    <?php 
        }
        ?>
</div>
                    <p><?php 
        echo wpyou_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 250, "...");
        ?>
</p>
                    <div class="meta">
                    本文由作者:<span><?php 
        the_author_posts_link();
        ?>
</span> 于 <span><?php 
        the_time('Y-m-d H:i');
        ?>
</span>发布在 [ <span><?php 
        the_category(' , ');
        ?>
</span>] 分类下
                        
                        <span>超过 <?php