1 Star 3 Fork 1

Godor / wpgodor

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
single.php 2.59 KB
一键复制 编辑 原始数据 按行查看 历史
Godor 提交于 2016-09-22 01:27 +08:00 . 修复了变量报错
<?php require_once('config.php'); ?>
<?php get_header(); ?>
<div id="single">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php setPostViews(get_the_ID()); ?>
<?php $args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'orderby' => 'menu_order',
'order' => 'ASC',
'post_mime_type' => 'image',
'post_status' => null,
'post_parent' => $post->ID
); ?>
<div id="top">
<div class="bar"></div>
<a class="<?php if (LOGO_FONT) { echo 'icon-icon'; } else { echo 'image-icon'; } ?>" href="javascript:history.back()"></a>
<div title="播放/暂停" data-id="<?php the_ID() ?>" class="icon-play"></div>
<div title="查看壁纸" class="icon-images"></div>
<h3 class="subtitle"><?php the_title(); ?></h3>
<div class="social">
<div class="like-icon">
<?php tz_printLikes(get_the_ID()); ?>
</div><!--
--><div>
<?php get_template_part( 'social' ); ?>
</div>
</div>
<div class="scrollbar"></div>
</div>
<div class="section">
<div class="images">
<div id="jg">
<?php $attachments = get_posts($args); if ($attachments) { ?>
<?php foreach ( $attachments as $attachment ) { $img = wp_get_attachment_image_src($attachment->ID,'thumbnail'); ?>
<a class="zoom icon-zoom" target="_blank" href="<?php echo wp_get_attachment_url( $attachment->ID , false ); ?>"><img width="300" height="<?php echo $img[2] ?>" src="<?php echo $img[0] ?>"/></a>
<?php } ?>
<?php } ?>
</div>
<a target="_blank" class="downloadlink">图片下载</a>
</div><div class="article">
<div>
<h1 class="title"><?php the_title(); ?></h1>
<div class="stuff">
<span><?php the_time('F j, Y'); ?> </span>
<span>阅读 <?php echo getPostViews(get_the_ID()); ?></span>
<span>字数 <?php $text = ''; echo count_words ($text); ?></span>
<span>评论 <?php comments_number( '0', '1', '%' ); ?></span>
<span>喜欢 <?php tz_printLikes(get_the_ID()); ?></span>
</div>
<div class="content">
<?php the_content(); ?>
</div>
<div class="comment commentdd" >添加评论</div>
<!-- 自带评论请自行添加样式相关,已经无力弄这个 -->
<?php comments_template('', true);?>
</div>
</div>
</div>
<div class="relate">
<?php get_template_part( 'related' ); ?>
</div>
<?php endwhile; endif; ?>
</div>
<?php get_footer(); ?>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/godor/wpgodor.git
git@gitee.com:godor/wpgodor.git
godor
wpgodor
wpgodor
master

搜索帮助