加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
single.php 3.06 KB
一键复制 编辑 原始数据 按行查看 历史
唐杰 提交于 2019-02-04 14:36 . v2.4
<?php get_header(); ?>
<div id="main">
<?php while ( have_posts() ) : the_post(); ?>
<article class="col-md-8 col-md-offset-2 view clearfix">
<h1 class="view-title"><?php the_title(); ?></h1>
<div class="view-meta">
<span>作者: <?php the_author() ?></span>
<span>分类: <?php the_category(',') ?></span>
<span>发布时间: <?php the_time('Y-m-d H:i') ?></span>
<span><?php edit_post_link('<i class="far fa-edit"></i> 编辑'); ?></span>
</div>
<div class="view-content">
<?php the_content(); ?>
</div>
<section class="view-tag">
<div class="pull-left"><i class="fas fa-tags"></i> <?php the_tags('',''); ?></div>
</section>
<?php if (get_option('tang_dashang') == '启用') { ?>
<section class="support-author">
<p><?php echo stripslashes(get_option('tang_dashang_info')); ?></p>
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#myModal"><i class="fas fa-gift"></i> 赞赏支持</button>
</section>
<?php } ?>
<section id="comments">
<?php comments_template(); ?>
</section>
</article>
<?php endwhile; ?>
<section class="col-md-8 col-md-offset-2 clearfix">
<div class="read">
<div class="read-head"><i class="fas fa-book"></i> 更多阅读</div>
<div class="read-list row">
<div class="col-md-6">
<ul>
<?php tangstyle_get_most_viewed(); ?>
</ul>
</div>
<div class="col-md-6">
<ul>
<?php $rand_posts = get_posts('numberposts=10&orderby=rand'); foreach( $rand_posts as $post ) : ?>
<li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>
</div>
<div class="read">
<div class="read-head"><i class="fas fa-tags"></i> 标签云</div>
<div class="read-list">
<?php wp_tag_cloud();?>
</div>
</div>
</section>
</div>
<!--modal-->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content single-dashang">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span>&times;</span></button>
<h4 class="modal-title" id="myModalLabel"><i class="fas fa-gift"></i> 赞赏支持</h4>
</div>
<div class="modal-body text-center">
<p><img src="<?php echo stripslashes(get_option('tang_dashang_alipay')); ?>"><img src="<?php echo stripslashes(get_option('tang_dashang_wechat')); ?>"></p>
<p>扫描二维码,输入您要赞赏的金额</p>
<p>赞赏不用多,心意到了即可</p>
</div>
</div>
</div>
</div>
<!--modal-->
<?php get_footer(); ?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化