现在,当我使用post格式时,我的摘录翻了一番。我希望在未选择帖子格式时有一个默认摘录。签出示例:http://themeforward.com/demo2/
对于我的摘录,要调用post格式,我使用以下代码:
<?php
if ( has_post_format( \'aside\' )) {
?>
<span class="icon-aside"></span>
<a href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'thmb-index\' ); } ?>
</a>
<span class="sub-title">Posted <?php the_time("F j, Y"); ?> by <?php the_author_posts_link(); ?> in <?php the_category(\', \') ?></span>
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<?php the_excerpt();
}
if ( has_post_format( \'chat\' )) {
?>
<span class="icon-chat"></span>
<a href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'thmb-index\' ); } ?>
</a>
<span class="sub-title"><?php the_time("F j, Y"); ?> / <?php the_author_posts_link(); ?> / <?php the_category(\', \') ?></span>
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<?php the_excerpt();
}
if ( has_post_format( \'gallery\' )) {
?>
<span class="icon-gallery"></span>
<a href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'thmb-index\' ); } ?>
</a>
<span class="sub-title">
<?php the_author_posts_link(); ?> / <?php the_category(\', \') ?> / <?php the_time("F j, Y"); ?>
</span>
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<?php the_content(); ?>
<?php comments_number( \'no responses\', \'one response\', \'% responses\' );
}
if ( has_post_format( \'image\' )) {
?>
<span class="icon-image"></span>
<a href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'thmb-index\' ); } ?>
</a>
<span class="sub-title"><?php the_time("F j, Y"); ?> / <?php the_author_posts_link(); ?> / <?php the_category(\', \') ?></span>
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<?php the_excerpt();
}
if ( has_post_format( \'link\' )) {
?>
<span class="icon-link"></span>
<h1><a href="<?php echo $first_link = catch_that_link(); ?>"><?php the_title(); ?></a></h1>
<a href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'thmb-index\' ); } ?>
</a>
<span class="sub-title"><?php the_time("F j, Y"); ?> / <?php the_author_posts_link(); ?> / <?php the_category(\', \') ?></span>
<?php comments_number( \'no responses\', \'one response\', \'% responses\' );
}
if ( has_post_format( \'quote\' )) {
?>
<span class="icon-quote"></span>
<a href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'thmb-index\' ); } ?>
</a>
<span class="sub-title"><?php the_time("F j, Y"); ?> / <?php the_author_posts_link(); ?> / <?php the_category(\', \') ?></span>
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<?php the_content();
}
if ( has_post_format( \'status\' )) {
?>
<span class="icon-status"></span>
<a href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'thmb-index\' ); } ?>
</a>
<span class="sub-title"><?php the_time("F j, Y"); ?> / <?php the_author_posts_link(); ?> / <?php the_category(\', \') ?></span>
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<?php the_excerpt();
}
if ( has_post_format( \'video\' )) {
?>
<span class="icon-video"></span>
<span class="sub-title"><?php the_time("F j, Y"); ?> / <?php the_author_posts_link(); ?> / <?php the_category(\', \') ?></span>
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<?php the_content();
}
if ( has_post_format( \'audio\' )) {
?>
<span class="icon-audio"></span>
<a href="<?php the_permalink() ?>">
<?php if ( has_post_thumbnail() ) { the_post_thumbnail( \'thmb-index\' ); } ?>
</a>
<span class="sub-title"><?php the_time("F j, Y"); ?> / <?php the_author_posts_link(); ?> / <?php the_category(\', \') ?></span>
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<?php the_content();
}
?>
。。。如果未选择帖子格式,我想获取以下内容:
<!-- Begin excerpt wrap -->
<div class="excerpt_wrap">
<div class="excerpt_inside">
<?php if ( has_post_thumbnail() ) { ?>
<a href="<?php the_permalink() ?>">
<?php the_post_thumbnail( \'thmb-index\' ); ?>
</a>
<?php } ?>
<div class="excerpt_content<?php if ( has_post_thumbnail() ) echo \' with-thumbnail\'; ?>">
<span class="index_title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></span>
<span class="sub-title">By <?php the_author_posts_link( ); ?> <span class="sub-title-divider">|</span> <?php the_time(\'F j, Y\'); ?> <span class="sub-title-divider">|</span> <a href="<?php the_permalink(); ?>/#commentlist"><?php comments_number( \'No comments\', \'One comment\', \'% comments\' ); ?></a></span>
<?php the_excerpt(); ?>
</div>
<!-- End excerpt wrap -->
</div>
</div>