-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontent.php
More file actions
90 lines (76 loc) · 3.27 KB
/
content.php
File metadata and controls
90 lines (76 loc) · 3.27 KB
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
<?php
/**
* @package uncode
*/
global $wp_query;
$vars = $wp_query->query_vars;
$single_post_width = (isset($vars['single_post_width']) && $vars['single_post_width'] !== '') ? $vars['single_post_width'] : 4;
$item_thumb_id = '';
$stylesArray = array(
'light',
'dark'
);
$general_style = ot_get_option('_uncode_general_style');
$overlay_style = $stylesArray[!array_search($general_style, $stylesArray) ];
$overlay_back_color = 'style-' . $overlay_style . '-bg';
$item_thumb_id = get_post_meta($post->ID, '_uncode_featured_media', 1);
if ($item_thumb_id === '') $item_thumb_id = get_post_thumbnail_id($post->ID);
$block_classes = array(
'tmb',
'tmb-post',
);
$block_classes[] = 'tmb-' . $general_style;
$block_classes[] = 'tmb-overlay-anim';
$block_classes[] = 'tmb-overlay-text-anim';
$block_classes[] = 'tmb-reveal-bottom';
$block_classes[] = 'tmb-shadowed';
$block_classes[] = 'tmb-bordered';
$block_classes[] = 'tmb-iso-w' . $single_post_width;
$block_classes[] = implode(' ', get_post_class());
$media_items = array();
$block_data = array();
$tmb_data = array();
$title_classes = array();
$layout = array();
$title_classes[] = 'h3';
global $uncode_index_map;
if (!class_exists('uncode_index')) {
echo __('Please active Uncode Core plugin to version > 1.0.5','uncode');
die();
}
$uncode_index_instance = new uncode_index($uncode_index_map);
$post_category = $uncode_index_instance->getCategoriesCss( $post->ID);
$block_data['content'] = get_the_content();
$block_data['single_categories_id'] = $post_category['cat_id'];
$block_data['single_categories'] = $uncode_index_instance->getCategoriesLink( $post->ID );
$block_data['classes'] = $block_classes;
$block_data['tmb_data'] = $tmb_data;
$block_data['id'] = $post->ID;
$block_data['media_id'] = $item_thumb_id;
$block_data['single_title'] = $post->post_title;
$block_data['single_width'] = $single_post_width;
$block_data['single_back_color'] = $general_style;
$block_data['single_icon'] = 'fa fa-plus2';
$block_data['single_text'] = 'under';
$block_data['text_padding'] = 'single-block-padding';
$block_data['single_style'] = $general_style;
$block_data['overlay_color'] = $overlay_back_color;
$block_data['overlay_opacity'] = '50';
$block_data['title_classes'] = $title_classes;
$block_data['link'] = get_permalink();
if (isset($vars['single_text_length'])) $block_data['text_length'] = $vars['single_text_length'];
if ($item_thumb_id !== '') {
$layout['media'] = array();
$media_items = explode(',', $item_thumb_id);
if (count($media_items) > 1) $block_data['poster'] = true;
}
$post_format = get_post_format();
if ($post_format !== 'aside' && $post_format !== 'quote') $layout['title'] = array();
if (($post_format !== 'aside' && $post_format !== 'link' && $post_format !== 'quote') && !is_archive()) $layout['meta'] = array();
$layout['text'] = array('full');
if ($post_format === 'quote' && !is_archive()) $layout['meta'] = array();
if ($post_format === 'aside' || $post_format === 'link') $layout['date'] = array();
if ($post_format !== 'aside' && $post_format !== 'link' && $post_format !== 'quote') $layout['sep-one'] = array();
if ($post_format !== 'aside' && $post_format !== 'link' && $post_format !== 'quote') $layout['author'] = array();
$layout['icon'] = array();
echo uncode_create_single_block($block_data, rand() , 'masonry', $layout, false, 'no');