/** * Block template to realize ability to choose custom template * */ function vc_teaser_template_form_field($settings, $value) { $teaser_templates = VcTeaserTemplates::getInstance(); $output = '<select name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-input wpb-select ' . $settings['param_name'] . ' ' . $settings['type'] . '">'; $templates = $teaser_templates->templates(); foreach ($templates as $key => $params) { $title = is_array($params) && !empty($params['title']) ? $params['title'] : $params; $selected = $key == $value ? ' selected="selected"' : ''; $output .= '<option class="' . $key . '" value="' . $key . '"' . $selected . '>' . $title . '</option>'; } $output .= '</select>'; return $output; }
// }} $el_class = $this->getExtraClass($el_class); $li_span_class = wpb_translateColumnsCountToSpanClass($grid_columns_count); /** * Find posts types taxonomies * {{ */ if ($grid_template == 'filtered_grid' && empty($grid_taxomonies)) { $taxonomies = get_object_taxonomies(!empty($args['post_type']) ? $args['post_type'] : get_post_types(array('public' => false, 'name' => 'attachment'), 'names', 'NOT')); } // }} $link_target = $grid_link_target == '_blank' ? ' target="_blank"' : ''; /** * Get teaser block template path */ $template_r = VcTeaserTemplates::getInstance(); $template_path = $template_r->getTemplatePath($grid_layout); if ($template_path !== false) { while ($my_query->have_posts()) { $link_title_start = $link_image_start = $p_link = $link_image_end = $p_img_large = ''; $my_query->the_post(); /** * Find taxonomies */ $categories_css = ''; if ($grid_template == 'filtered_grid') { /** @var $post_categories get list of categories */ $post_categories = wp_get_object_terms($my_query->post->ID, $taxonomies); foreach ($post_categories as $cat) { if (!in_array($cat->term_id, $teaser_categories)) { $teaser_categories[] = $cat->term_id;
"description" => __("Teaser layout.", "js_composer") ), array( "type" => "loop", "heading" => __("Loop", "js_composer"), "param_name" => "loop", 'settings' => array( 'size' => array('hidden' => false, 'value' => 90), 'order_by' => array('value' => 'date'), ), "description" => __("Create super mega query.", "js_composer") ), array( "type" => "vc_link", "heading" => __("Link", "js_composer"), "param_name" => "link", "description" => __("This adds a link selection box", "js_composer") ) ) // 'html_template' => dirname(__DIR__).'/composer/shortcodes_templates/vc_posts_grid.php' ) );*/ VcTeaserTemplates::getInstance('vc_posts_grid', 'teaser_template'); WPBMap::layout(array('id' => 'column_12', 'title' => '1/2')); WPBMap::layout(array('id' => 'column_12-12', 'title' => '1/2 + 1/2')); WPBMap::layout(array('id' => 'column_13', 'title' => '1/3')); WPBMap::layout(array('id' => 'column_13-13-13', 'title' => '1/3 + 1/3 + 1/3')); WPBMap::layout(array('id' => 'column_13-23', 'title' => '1/3 + 2/3')); WPBMap::layout(array('id' => 'column_14', 'title' => '1/4')); WPBMap::layout(array('id' => 'column_14-14-14-14', 'title' => '1/4 + 1/4 + 1/4 + 1/4')); WPBMap::layout(array('id' => 'column_16', 'title' => '1/6')); WPBMap::layout(array('id' => 'column_11', 'title' => '1/1'));