forked from mirai-mamori/Sakurairo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-word.php
52 lines (49 loc) · 2.06 KB
/
page-word.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
/**
* Template Name: 说说模版
*/
get_header();
?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<div class="cbp_shuoshuo">
<?php
query_posts("post_type=shuoshuo & post_status=publish & posts_per_page=-1");
if (have_posts()) : ?>
<ul class="cbp_tmtimeline">
<?php
while (have_posts()) : the_post(); ?>
<li>
<span class="shuoshuo_author_img"><img src="<?php echo get_avatar_profile_url(get_the_author_meta('ID')); ?>" class="avatar avatar-48" width="48" height="48"></span>
<div class="cbp_tmlabel">
<p><?php the_content(); ?></p>
<p class="shuoshuo_time"><i class="fa fa-clock-o"></i> <?php the_time('Y年n月j日 G:i'); ?></p>
</div>
</li>
<?php endwhile; ?>
</ul>
<?php
else : ?>
<h3 style="text-align: center;">你还没有发表说说噢!</h3>
<p style="text-align: center;">赶快去发表你的第一条说说心情吧!</p>
<?php
endif; ?>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<script type="text/javascript">
document.addEventListener('DOMContentLoaded', ()=>{
document.querySelectorAll('.cbp_tmtimeline li').forEach((p)=>{
var e = p.querySelector('.shuoshuo_author_img img')
p.addEventListener("mouseenter",()=>{
e.classList.add("zhuan");
})
p.addEventListener("mouseleave",()=>{
e.classList.remove("zhuan");
})
})
}, false);
</script>
<?php
get_footer();
?>