-
Notifications
You must be signed in to change notification settings - Fork 4
/
widget-post-block.php
111 lines (72 loc) · 3.29 KB
/
widget-post-block.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<?php
// Get the post format
$post_format = get_post_format($post->ID);
?><div class="item<?php echo ($post_format ? " ".$post_format : ''); ?>"<?php if (!has_post_thumbnail($post->ID) || $hide_thumbnails){ ?> style="padding-left:0; width:100%;"<?php } ?>>
<?php if (has_post_thumbnail($post->ID) && !$hide_thumbnails){ ?>
<a href="<?php the_permalink() ?>"><?php
$featured_caption = get_the_title($post->ID);
$featured_image = get_the_post_thumbnail($post->ID);
echo $featured_image;
?></a>
<?php } ?>
<?php switch ($post_format){
case 'audio':
case 'video':
case 'image':
case 'chat':
case 'gallery':
case '':
?><h5><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h5>
<?php if (of_get_option('js_hide_metainfo') == 0){ ?>
<h6><?php _e('Posted on','crowdpress'); ?> <strong><?php the_time('F j, Y') ?></strong> <?php _e('by','crowdpress'); ?> <?php the_author_posts_link(); ?> <?php _e('in','crowdpress'); ?>
<?php the_category(', '); ?><br /><?php comments_number('', '<a href="'.get_permalink().'#comments">'.__('1 Comment','crowdpress').'</a>', '<a href="'.get_permalink().'#comments">% '.__('Comments','crowdpress').'</a>' ); ?></a></h6>
<?php }
break;
} ?>
<?php switch ($post_format){
case 'audio':
if ( function_exists('the_post_format_audio') ) { echo get_the_post_format_media( 'audio' ); } ?>
<?php the_excerpt(); ?>
<?php break;
case 'video':
if ( function_exists('the_post_format_video') ) { echo get_the_post_format_media( 'video' ); } ?>
<?php the_excerpt(); ?>
<?php break;
case 'image':
?><div class="image-video-post"><?php echo $post->format_content; ?></div>
<?php the_excerpt(); ?>
<?php break;
case 'quote':
?><p>“<?php echo get_the_content($post->ID); ?>”</p><p style="padding-top:5px; padding-bottom:10px; color:#888;">— <?php the_title(); ?></p>
<?php break;
case 'gallery':
the_excerpt();
break;
case 'link':
?><h5><a href="<?php echo get_the_content(); ?>"><?php the_title(); ?></a></h5>
<?php if (of_get_option('js_hide_metainfo') == 0){ ?>
<h6><?php _e('Posted on','crowdpress'); ?> <strong><?php the_time('F j, Y') ?></strong> <?php _e('by','crowdpress'); ?> <?php the_author_posts_link(); ?> <?php _e('in','crowdpress'); ?>
<?php the_category(', '); ?><br /><?php comments_number('', '<a href="'.get_permalink().'#comments">'.__('1 Comment','crowdpress').'</a>', '<a href="'.get_permalink().'#comments">% '.__('Comments','crowdpress').'</a>' ); ?></a></h6>
<?php }
break;
case 'aside':
case 'chat':
case 'status':
the_content();
break;
case '':
case 'gallery':
the_excerpt();
break;
} ?>
<?php switch ($post_format){
case 'status':
case 'aside':
case 'quote':
if (of_get_option('js_hide_metainfo') == 0){ ?>
<h6><?php _e('Posted on','crowdpress'); ?> <strong><?php the_time('F j, Y') ?></strong> <?php _e('by','crowdpress'); ?> <?php the_author_posts_link(); ?> <?php _e('in','crowdpress'); ?>
<?php the_category(', '); ?><br /><?php comments_number('', '<a href="'.get_permalink().'#comments">'.__('1 Comment','crowdpress').'</a>', '<a href="'.get_permalink().'#comments">% '.__('Comments','crowdpress').'</a>' ); ?></a></h6>
<?php }
break;
}
?></div>