forked from zhw2590582/Teahouse-Wordpress-Theme
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcustom-comment.php
91 lines (74 loc) · 2.92 KB
/
custom-comment.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<?php
/*
Template Name: Custom Comment
*/
?>
<?php get_header(); ?>
<div id="content">
<div class="posts">
<!-- grab the posts -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article <?php post_class('post'); ?>>
<!-- grab the music -->
<?php if ( get_post_meta($post->ID, 'music', true) ) { ?>
<div class="post-image audio post-format-audio">
<!-- grab the featured image -->
<?php if ( get_post_meta($post->ID, 'picture', true) ) { ?>
<a class="featured-image" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<img src="<?php echo get_post_meta( $post->ID, 'picture', true ); ?>" class="attachment-large-image wp-post-image">
</a>
<?php } else { ?>
<?php if ( has_post_thumbnail() ) { ?>
<a class="featured-image" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail( 'large-image' ); ?>
</a>
<?php } ?>
<?php } ?>
<div class="audio-wrapper">
<div class="me-wrap">
<audio class="wp-audio-shortcode" preload="none" style="width: 100%">
<source type="audio/mpeg" src="<?php echo get_post_meta( $post->ID, 'music', true ); ?>">
</audio>
</div>
</div>
</div>
<?php } else { ?>
<!-- grab the featured image -->
<?php if ( get_post_meta($post->ID, 'picture', true) ) { ?>
<a class="featured-image" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<img src="<?php echo get_post_meta( $post->ID, 'picture', true ); ?>" class="attachment-large-image wp-post-image">
</a>
<?php } else { ?>
<?php if ( has_post_thumbnail() ) { ?>
<a class="featured-image" href="<?php the_permalink(); ?>" title="<?php the_title(); ?>">
<?php the_post_thumbnail( 'large-image' ); ?>
</a>
<?php } ?>
<?php } ?>
<?php } ?>
<div class="box-wrap">
<div class="box">
<header>
<div class="date-title"><?php echo get_the_date(); ?></div>
<?php if(is_single() || is_page()) { ?>
<h1 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h1>
<?php } else { ?>
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
<?php } ?>
</header>
<!-- post content -->
<div class="post-content">
<?php the_content(__( 'Read More','teahouse')); ?>
<div id="archive">
<?php comments_template(); ?>
</div><!-- archive -->
</div><!-- post content -->
</div><!-- box -->
</div><!-- box wrap -->
</article><!-- post-->
<?php endwhile; ?>
<?php endif; ?>
</div>
</div><!-- content -->
<!-- footer -->
<?php get_footer(); ?>