PluginProbe ʕ •ᴥ•ʔ
Shortcodes and extra features for Phlox theme / 1.3.1
Shortcodes and extra features for Phlox theme v1.3.1
2.17.22 2.17.21 2.17.20 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.6 1.0.9 1.1.0 1.3.0 1.3.1 1.3.10 1.3.14 1.3.2 1.3.3 1.3.6 1.4.0 1.4.1 1.4.2 1.5.0 1.5.2 1.6.0 1.6.2 1.6.4 1.7.0 1.7.2 2.10.0 2.10.1 2.10.3 2.10.5 2.10.7 2.10.8 2.10.9 2.11.0 2.11.1 2.11.2 2.12.0 2.14.0 2.15.0 2.15.2 2.15.4 2.15.5 2.15.6 2.15.7 2.15.8 2.15.9 2.16.0 2.16.1 2.16.2 2.16.3 2.16.4 2.17.0 2.17.1 2.17.12 2.17.13 2.17.14 2.17.15 2.17.16 2.17.2 2.17.3 2.17.4 2.17.5 2.17.6 2.17.8 2.17.9 2.4.12 2.4.13 2.4.14 2.4.16 2.4.18 2.4.19 2.4.9 2.5.0 2.5.1 2.5.10 2.5.11 2.5.12 2.5.13 2.5.14 2.5.15 2.5.16 2.5.17 2.5.19 2.5.2 2.5.20 2.5.3 2.5.7 2.5.8 2.5.9 2.6.0 2.6.1 2.6.10 2.6.12 2.6.13 2.6.14 2.6.15 2.6.16 2.6.17 2.6.19 2.6.2 2.6.20 2.6.4 2.6.5 2.6.7 2.7.0 2.7.1 2.7.10 2.7.11 2.7.12 2.7.13 2.7.14 2.7.2 2.7.3 2.7.4 2.7.5 2.7.6 2.7.7 2.7.8 2.7.9 2.8.0 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.9 2.9.0 2.9.12 2.9.14 2.9.15 2.9.16 2.9.17 2.9.18 2.9.19 2.9.2 2.9.20 2.9.21 2.9.22 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8
auxin-elements / includes / elements / latest-items.php
auxin-elements / includes / elements Last commit date
about-widget.php 9 years ago accordion-api.php 9 years ago accordion.php 9 years ago attachment-url.php 10 years ago audio.php 9 years ago button.php 9 years ago code.php 9 years ago contact-box.php 9 years ago contact-form.php 9 years ago divider.php 9 years ago dropcap.php 9 years ago facebook.php 9 years ago flickr.php 9 years ago gallery.php 9 years ago gmap.php 9 years ago highlight.php 9 years ago image.php 9 years ago instagram-feed.php 9 years ago latest-items.php 10 years ago latest-posts-slider.php 9 years ago popular-posts-widget.php 9 years ago quote.php 9 years ago recent-posts-grid-carousel.php 9 years ago recent-posts-land-style.php 9 years ago recent-posts-masonry.php 9 years ago recent-posts-tiles.php 9 years ago recent-posts-timeline.php 9 years ago recent-posts-widget.php 9 years ago recent-posts.php 9 years ago sample-element.php 10 years ago search.php 9 years ago socials-list.php 9 years ago tabs-api.php 9 years ago tabs.php 9 years ago text.php 9 years ago video.php 9 years ago
latest-items.php
503 lines
1 <?php
2 /**
3 * This is a sample of how to create a new element on widgets and visual composer element
4 * Auxin callout widget you can set all the options of this widget here like widget definitation,
5 * its element on siteorigin page builder, visual composer and under appearance/ widgets
6 */
7 // const THEME_NAME = "PHLOX";
8 // TODO: item should change to portfolio
9 function get_auxin_latest_items_vc( $master_array ) {
10
11 $auxin_latest_items_vc = array( // shortcode info here
12 'name' => __("Auxin latest_items", 'auxin-elements' ), // [str] name of your shortcode for human reading inside element list
13 'auxin_output_callback' => 'auxin_widget_latest_items', // [str] NAme of widget function callback which define below this array
14 'base' => 'auxin_latest_items', // [str] shortcode tag. For [my_shortcode] shortcode base is my_shortcode
15 'description' => __('This is will add latest_items element', 'auxin-elements'), // [str] short description of your element, it will be visible in "Add element" window
16 'class' => 'auxin-latest_items', // [str] CSS class which will be added to the shortcode's content element in the page edit screen in Visual Composer backend edit mode. adds 3 classes like testt_o testt_v and testt
17 'show_settings_on_create' => true, // [Boolean] set it to false if content element's settings page shouldn't open automatically after adding it to the stage
18 'weight' => 1, // [Int] content elements with greater weight will be rendered first in "Content Elements" grid, higher appear upper
19 'category' => THEME_NAME, // [str] category which best suites to describe functionality of this shortcode.
20 'group' => '', // [str] TODO: no idea Group your params in groups, they will be divided in tabs in the edit element window
21 'admin_enqueue_js' => '', // [str/arr] this js will be loaded in the js_composer edit mode
22 'admin_enqueue_css' => '', // [str/arr] absolute url to css file
23 'front_enqueue_js' => '', // [str/arr] to load custom js file in the frontend editing mode
24 'front_enqueue_css' => '', // [str/arr] to load custom css file in the frontend editing mode
25 'icon' => '', // URL or CSS class with icon image
26 'custom_markup' => '', // [str] custom html markup for representing shortcode in visual composer editor. This will replace visual composer element where shows the param and its value
27 'js_view' => '', // TODO: no idea Set custom backbone.js view controller for this content element there is a sample wich sets it to
28 'html_template' => '', // it uses to oerride the output of shortcode. Path to shortcode template. This is useful if you want to reassign path of existing content elements lets say override the seprator defined by visual composer.
29 'deprecated' => '', // enter version number of visual composer from which content element will be deprecated
30 'content_element' => '', // If set to false, content element will be hidden from "Add element" window. It is handy to use this param in pair with 'deprecated' param
31 'as_parent' => '', // use only|except attributes to limit child shortcodes (separate multiple values with comma)
32 'as_child' => '', // use only|except attributes to limit parent (separate multiple values with comma)
33 'params' => array(
34 array( // array of parameter
35 'param_name' => 'col', // [str] must be the same as your parameter name
36 'type' => 'textfield', // [str] attribute type
37 'value' => '33', // [str/arr] default attribute's value
38 'def_value' => '33', // [str/arr] default attribute's value
39 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
40 'class' => 'col', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
41 'heading' => __('col','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
42 'description' => __('If you choose Callout a big box appears around the content','auxin-elements'),
43 'admin_label' => true, // [bool] show value of param in Visual Composer editor
44 'dependency' => '', // [arr] define param visibility depending on other field value
45 'weight' => '', // [int] params with greater weight will be rendered first
46 'group' => '' , // [str] use it to divide your params within groups (tabs)
47 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
48 ),
49 array( // array of parameter
50 'param_name' => 'mode', // [str] must be the same as your parameter name
51 'type' => 'dropdown', // [str] attribute type
52 'def_value' => 'no', // [str/arr] default attribute's value
53 'value' => array( 'none' => __('none', 'auxin-elements'), 'caption-over' => __('caption-over', 'auxin-elements') ),
54 'holder' => 'dropdown', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
55 'class' => 'mode', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
56 'heading' => __('mode type','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
57 'description' => __('The round is used got button','auxin-elements'),
58 'admin_label' => true, // [bool] show value of param in Visual Composer editor
59 'dependency' => '', // [arr] define param visibility depending on other field value
60 'weight' => '', // [int] params with greater weight will be rendered first
61 'group' => '' , // [str] use it to divide your params within groups (tabs)
62 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
63 ),
64 array( // array of parameter
65 'param_name' => 'grid', // [str] must be the same as your parameter name
66 'type' => 'textfield', // [str] attribute type
67 'value' => '', // [str/arr] default attribute's value
68 'def_value' => '', // [str/arr] default attribute's value
69 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
70 'class' => 'grid', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
71 'heading' => __('grid','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
72 'description' => __('attachment grid', 'auxin-elements'),
73 'admin_label' => true, // [bool] show value of param in Visual Composer editor
74 'dependency' => '', // [arr] define param visibility depending on other field value
75 'weight' => '', // [int] params with greater weight will be rendered first
76 'group' => '' , // [str] use it to divide your params within groups (tabs)
77 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
78 ),
79 array( // array of parameter
80 'param_name' => 'num', // [str] must be the same as your parameter name
81 'type' => 'textfield', // [str] attribute type
82 'value' => '', // [str/arr] default attribute's value
83 'def_value' => '', // [str/arr] default attribute's value
84 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
85 'class' => 'num', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
86 'heading' => __('num','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
87 'description' => __('attachment num', 'auxin-elements'),
88 'admin_label' => true, // [bool] show value of param in Visual Composer editor
89 'dependency' => '', // [arr] define param visibility depending on other field value
90 'weight' => '', // [int] params with greater weight will be rendered first
91 'group' => '' , // [str] use it to divide your params within groups (tabs)
92 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
93 ),
94 array( // array of parameter
95 'param_name' => 'nav', // [str] must be the same as your parameter name
96 'type' => 'dropdown', // [str] attribute type
97 'def_value' => 'pagination', // [str/arr] default attribute's value
98 'value' => array( 'pagination' => __('pagination', 'auxin-elements'), 'regular' => __('regular', 'auxin-elements') ),
99 'holder' => 'dropdown', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
100 'class' => 'nav', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
101 'heading' => __('nav type','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
102 'description' => __('The round is used got button','auxin-elements'),
103 'admin_label' => true, // [bool] show value of param in Visual Composer editor
104 'dependency' => '', // [arr] define param visibility depending on other field value
105 'weight' => '', // [int] params with greater weight will be rendered first
106 'group' => '' , // [str] use it to divide your params within groups (tabs)
107 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
108 ),
109 array( // array of parameter
110 'param_name' => 'title', // [str] must be the same as your parameter name
111 'type' => 'textfield', // [str] attribute type
112 'value' => '', // [str/arr] default attribute's value
113 'def_value' => '', // [str/arr] default attribute's value
114 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
115 'class' => 'title', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
116 'heading' => __('title','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
117 'description' => __('attachment link', 'auxin-elements'),
118 'admin_label' => true, // [bool] show value of param in Visual Composer editor
119 'dependency' => '', // [arr] define param visibility depending on other field value
120 'weight' => '', // [int] params with greater weight will be rendered first
121 'group' => '' , // [str] use it to divide your params within groups (tabs)
122 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
123 ),
124 array( // array of parameter
125 'param_name' => 'posttype', // [str] must be the same as your parameter name
126 'type' => 'dropdown', // [str] attribute type
127 'def_value' => 'pagination', // [str/arr] default attribute's value
128 'value' => array( 'post' => __('post', 'auxin-elements'), 'regular' => __('regular', 'auxin-elements') ),
129 'holder' => 'dropdown', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
130 'class' => 'posttype', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
131 'heading' => __('posttype type','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
132 'description' => __('The round is used got button','auxin-elements'),
133 'admin_label' => true, // [bool] show value of param in Visual Composer editor
134 'dependency' => '', // [arr] define param visibility depending on other field value
135 'weight' => '', // [int] params with greater weight will be rendered first
136 'group' => '' , // [str] use it to divide your params within groups (tabs)
137 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
138 ),
139 array( // array of parameter
140 'param_name' => 'cat_id', // [str] must be the same as your parameter name
141 'type' => 'textfield', // [str] attribute type
142 'value' => '', // [str/arr] default attribute's value
143 'def_value' => '', // [str/arr] default attribute's value
144 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
145 'class' => 'cat_id', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
146 'heading' => __('cat_id','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
147 'description' => __('attachment alt', 'auxin-elements'),
148 'admin_label' => true, // [bool] show value of param in Visual Composer editor
149 'dependency' => '', // [arr] define param visibility depending on other field value
150 'weight' => '', // [int] params with greater weight will be rendered first
151 'group' => '' , // [str] use it to divide your params within groups (tabs)
152 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
153 ),
154 array( // array of parameter
155 'param_name' => 'taxonomy', // [str] must be the same as your parameter name
156 'type' => 'textfield', // [str] attribute type
157 'value' => 'category', // [str/arr] default attribute's value
158 'def_value' => 'category', // [str/arr] default attribute's value
159 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
160 'class' => 'taxonomy', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
161 'heading' => __('width','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
162 'description' => __('attachment width', 'auxin-elements'),
163 'admin_label' => true, // [bool] show value of param in Visual Composer editor
164 'dependency' => '', // [arr] define param visibility depending on other field value
165 'weight' => '', // [int] params with greater weight will be rendered first
166 'group' => '' , // [str] use it to divide your params within groups (tabs)
167 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
168 ),
169 array( // array of parameter
170 'param_name' => 'view_excerpt', // [str] must be the same as your parameter name
171 'type' => 'dropdown', // [str] attribute type
172 'def_value' => 'no', // [str/arr] default attribute's value
173 'value' => array( 'yes' => __('Yes', 'auxin-elements'), 'no' => __('No', 'auxin-elements') ),
174 'holder' => 'dropdown', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
175 'class' => 'view_excerpt', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
176 'heading' => __('view_excerpt ?','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
177 'description' => __('The round is used got button','auxin-elements'),
178 'admin_label' => true, // [bool] show value of param in Visual Composer editor
179 'dependency' => '', // [arr] define param visibility depending on other field value
180 'weight' => '', // [int] params with greater weight will be rendered first
181 'group' => '' , // [str] use it to divide your params within groups (tabs)
182 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
183 ),
184 array( // array of parameter
185 'param_name' => 'view_title', // [str] must be the same as your parameter name
186 'type' => 'dropdown', // [str] attribute type
187 'def_value' => 'no', // [str/arr] default attribute's value
188 'value' => array( 'yes' => __('Yes', 'auxin-elements'), 'no' => __('No', 'auxin-elements') ),
189 'holder' => 'dropdown', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
190 'class' => 'view_title', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
191 'heading' => __('view_title ?','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
192 'description' => __('The round is used got button','auxin-elements'),
193 'admin_label' => true, // [bool] show value of param in Visual Composer editor
194 'dependency' => '', // [arr] define param visibility depending on other field value
195 'weight' => '', // [int] params with greater weight will be rendered first
196 'group' => '' , // [str] use it to divide your params within groups (tabs)
197 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
198 ),
199 array( // array of parameter
200 'param_name' => 'excerpt_len', // [str] must be the same as your parameter name
201 'type' => 'textfield', // [str] attribute type
202 'value' => '100', // [str/arr] default attribute's value
203 'def_value' => '100', // [str/arr] default attribute's value
204 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
205 'class' => 'excerpt_len', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
206 'heading' => __('excerpt_len','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
207 'description' => __('attachment width', 'auxin-elements'),
208 'admin_label' => true, // [bool] show value of param in Visual Composer editor
209 'dependency' => '', // [arr] define param visibility depending on other field value
210 'weight' => '', // [int] params with greater weight will be rendered first
211 'group' => '' , // [str] use it to divide your params within groups (tabs)
212 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
213 ),
214 array( // array of parameter
215 'param_name' => 'section_index', // [str] must be the same as your parameter name
216 'type' => 'textfield', // [str] attribute type
217 'value' => 'category', // [str/arr] default attribute's value
218 'def_value' => 'category', // [str/arr] default attribute's value
219 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
220 'class' => 'section_index', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
221 'heading' => __('section_index','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
222 'description' => __('attachment section_index', 'auxin-elements'),
223 'admin_label' => true, // [bool] show value of param in Visual Composer editor
224 'dependency' => '', // [arr] define param visibility depending on other field value
225 'weight' => '', // [int] params with greater weight will be rendered first
226 'group' => '' , // [str] use it to divide your params within groups (tabs)
227 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
228 ),
229 array( // array of parameter
230 'param_name' => 'paged', // [str] must be the same as your parameter name
231 'type' => 'textfield', // [str] attribute type
232 'value' => 'category', // [str/arr] default attribute's value
233 'def_value' => 'category', // [str/arr] default attribute's value
234 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
235 'class' => 'paged', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
236 'heading' => __('paged','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
237 'description' => __('attachment paged', 'auxin-elements'),
238 'admin_label' => true, // [bool] show value of param in Visual Composer editor
239 'dependency' => '', // [arr] define param visibility depending on other field value
240 'weight' => '', // [int] params with greater weight will be rendered first
241 'group' => '' , // [str] use it to divide your params within groups (tabs)
242 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
243 ),
244 array( // array of parameter
245 'param_name' => 'extra_classes', // [str] must be the same as your parameter name
246 'type' => 'textfield', // [str] attribute type
247 'value' => '', // [str/arr] default attribute's value
248 'def_value' => '', // [str/arr] default attribute's value
249 'holder' => 'textfield', // [str] HTML tag name where Visual Composer will store attribute value in Visual Composer edit mode
250 'class' => 'extra_classes', // [str] class name that will be added to the "holder" HTML tag. Useful if you want to target some CSS rules to specific items in the backend edit interface
251 'heading' => __('Extra class name','auxin-elements'), // [str] human friendly title of your param. Will be visible in shortcode's edit screen
252 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'auxin-elements'),
253 'admin_label' => true, // [bool] show value of param in Visual Composer editor
254 'dependency' => '', // [arr] define param visibility depending on other field value
255 'weight' => '', // [int] params with greater weight will be rendered first
256 'group' => '' , // [str] use it to divide your params within groups (tabs)
257 'edit_field_class' => '' // [str] set param container width in content element edit window. According to Bootstrap logic eg. col-md-4. (Available from Visual Composer 4.0)
258 )
259
260 // , // another array for another param
261 )
262 );
263
264 // push this node in master_array
265 $master_array[] = $auxin_latest_items_vc;
266
267 return $master_array;
268 }
269
270 add_filter( 'auxin_master_array_shortcodes', 'get_auxin_latest_items_vc', 10, 1 );
271
272
273 // This is the widget call back in fact the front end out put of this widget comes from this function
274 function auxin_widget_latest_items( $atts, $shortcode_content = null ){
275
276
277 // @TODO
278 // Defining default attributes
279 $default_atts = array(
280 'title' => '', // header title
281 'size' => 100, // section size
282 'col' => '33', // one .. six-column
283 'mode' => 'none', // caption-over, none
284 'grid' => '', // custome grid
285 'num' => -1, // fetch num
286 'nav' => 'pagination', // pagination , filterable
287 'title' => '', // widget header title
288 'posttype' => 'post', // posttype
289 'cat_id' => '',
290 'taxonomy' => 'category',
291 'view_excerpt' => 'yes',
292 'view_title' => 'yes',
293 'excerpt_len' => '100',
294 'section_index'=> '',
295 'paged' => '1',
296 'col' => 3,
297 'extra_classes' => '', // custom css class names for this element
298 'custom_el_id' => '', // custom id attribute for this element
299 );
300
301 // Widget Info -----------------------------
302
303 // Widget general info
304 $before_widget = $after_widget = '';
305 $before_title = $after_title = '';
306
307 // If widget info is passed, extract them in above variables
308 if( isset( $atts['widget_info'] ) ){
309 extract( $atts['widget_info'] );
310 }
311 $widget_title = isset( $atts['widget_title'] ) ? $atts['widget_title'] : '';
312
313 // CSS class names for section -------------
314
315 // The default CSS classes for widget container
316 // Note that 'widget-container' should be in all element
317 $default_atts['_css_classes'] = array( 'widget-container' );
318
319 // Parse shortcode attributes
320 $parsed_atts = shortcode_atts( $default_atts, $atts, __FUNCTION__ );
321
322 // Extract array nodes in variables
323 extract( $parsed_atts );
324
325 // Defining extra class names --------------
326
327 // Add extra class names to class list here - widget-{element_name}
328 $_css_classes[] = 'widget-pages'; // @TODO define widget-{element_name}
329
330 // Covering classes in list to class attribute for main section
331 $section_class_attr = auxin_make_html_class_attribute( $_css_classes, $extra_classes );
332
333 $content = wpb_js_remove_wpautop($shortcode_content, true); // fix unclosed/unwanted paragraph tags in $content
334 // TODO: axi should change to aux
335 global $axi_img_size;
336
337 // Defining query base on needs ------------
338
339 // create an id for this section
340 $uid = "axi_pbei".$section_index;
341 if(empty($section_index)) $uid = uniqid("axi_pbei");
342
343 // validate number fetched items
344 $num = ((int)$num > 0)?$num:-1;
345 // set column number to 3 if its empty
346 $col = empty($col)?"1/3":$col;
347
348 // get number of grid column ---------------------------------
349 // actual col size
350 // get number of grid column
351 $wrapper_size = empty($size)?100:$size;
352 $col_actual = ($wrapper_size / 100) * (int)$col;
353 $col_num = floor(100 / $col_actual);
354 $col_num = $col_num > 5?5:$col_num; // max column num is 5
355 // get thumbnsil size name
356 $image_size_name = "i".$col_num;
357
358
359
360 // get all taxonomy items for filtering purpose ---------------
361 $tax_args = array('taxonomy' => $taxonomy, 'terms' => $cat_id );
362
363 if(empty($cat_id) || $cat_id == "all" ) $tax_args = "";
364
365 // get all taxonomy items for filtering purpose ---------------
366 $tax_args = array('taxonomy' => $taxonomy, 'terms' => $cat_id );
367
368 if(empty($cat_id) || $cat_id == "all" ) $tax_args = "";
369
370 // Create wp_query to get pages
371 $query_args = array(
372 'post_type' => $posttype,
373 'orderby' => "menu_order date",
374 'post_status'=> 'publish',
375 'posts_per_page' => $num,
376 'paged' => $paged,
377 'tax_query' => array($tax_args)
378 );
379
380 $query_res = null;
381 $query_res = new WP_Query( $query_args );
382
383 ob_start();
384 ?>
385 <?php echo $before_widget; ?>
386
387 <section id="<?php echo $custom_el_id; ?>" <?php echo $section_class_attr; ?>>
388
389 <?php
390 if( ! empty( $before_title ) ){
391 echo $before_title . $widget_title . $after_title;
392 } elseif( ! empty( $title ) ){
393 echo get_widget_title( $title );
394 }
395 ?>
396
397 <div class="widget-inner">
398
399 <div class="aux-col-wrapper <?php echo "aux-$col"; ?>"> // faghat vase seton
400
401 <?php if( $query_res->have_posts() ): while ( $query_res->have_posts() ) : $query_res->the_post(); ?>
402
403 <article class="aux-col">
404 <!-- @TODO - The output for each element here -->
405 <?php // reset current item image size name
406 $thumb_size = $image_size_name;
407
408 // is current item highlighted?
409 $is_highlight = get_post_meta($th_query->post->ID, 'is_highlighted', true);
410
411 // this is the css class name that indicates the thumbnail size in browser
412 $classSize = "";
413 if($is_highlight == "yes" && $mode == "caption-over"){
414 $classSize = "height2";
415 $thumb_size .= "_2"; // if the item is marked as highlited, make it 2x bigger in height
416 }else{
417 $classSize = "height1";
418 $thumb_size .= "_1";
419 }
420
421 // get suite thumb size
422 $dimentions = $axi_img_size[$thumb_size];
423
424 // retinafy thumbnail
425 $dimentions[0] = 1.8 * $dimentions[0];
426 $dimentions[1] = 1.8 * $dimentions[1];
427 ?>
428
429 <?php // get the current item tag for filtering content
430 $tax_name = 'portfolio-tag';
431 $tax_terms = wp_get_post_terms($th_query->post->ID, $tax_name);
432 // stores all current item tag slugs az class attrs
433 $tax_slugs = "";
434
435 if($tax_terms){
436 foreach($tax_terms as $term)
437 $tax_slugs .= " ".$term->slug;
438 }
439 ?>
440
441 <article class="col" data-filter="<?php echo $tax_slugs; ?>" >
442 <figure>
443 <div class="imgHolder <?php echo $classSize; ?>">
444 <a href="<?php the_permalink(); ?>">
445 <?php
446 auxin_the_post_thumbnail($th_query->post->ID, $dimentions[0], $dimentions[1], true, 70);
447 ?>
448 <?php if ($mode == "caption-over"): ?>
449
450 <em>
451 <?php if($view_title == 'yes'){ ?>
452 <h4><?php the_title(); ?></h4>
453 <?php } ?>
454
455 <?php
456 $cat_terms = wp_get_post_terms(get_the_ID(), 'project-type');
457 if(!empty($cat_terms)){
458 echo '<i>';
459 $cnt = 0;
460 foreach($cat_terms as $term){
461 echo $cnt == 0?'':' / ';
462 echo $term->name;
463 $cnt++;
464 }
465 echo '</i>';
466 }
467 ?>
468 </em>
469
470 <?php endif; ?>
471 </a>
472 </div>
473 <?php if ($mode != "caption-over") { ?>
474
475 <figcaption>
476 <h4 class="fig-title">
477 <?php if($view_title == 'yes'){ ?>
478 <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a>
479 <?php } ?>
480 </h4>
481 <?php if($view_excerpt == "yes") auxin_the_trimmed_string(get_the_excerpt(),$excerpt_len); ?>
482 </figcaption>
483
484 <?php } ?>
485 </figure>
486 </article>
487 </article>
488 <?php
489 endwhile; endif;
490 wp_reset_query();
491 ?>
492
493 </div><!-- aux-col-wrapper -->
494 </div><!-- widget-inner -->
495 </section><!-- widget-container -->
496
497 <?php echo $after_widget; ?>
498
499 <?php
500 return ob_get_clean();
501 }
502
503