function gazeta_map_grid_posts() { $args = array('name' => __('Grid Posts', 'gazeta'), 'base' => 'gazeta_grid_posts', 'category' => __('Gazeta', 'gazeta'), 'class' => 'gazeta', 'icon' => 'gazeta', 'description' => __('Display the Grid Posts.', 'gazeta'), 'params' => array(array('type' => 'checkbox', 'holder' => 'div', 'class' => '', 'param_name' => 'main_query', 'value' => array(__('Main Content', 'gazeta') => 'yes'), 'description' => __('Make this as Main content, the page navigation will work.', 'gazeta')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Heading', 'gazeta'), 'param_name' => 'heading'), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('ID', 'gazeta'), 'param_name' => 'id', 'value' => 'grid_posts-' . rand(1000, 9999), 'description' => __('<strong>IMPORTANT!</strong> You should change to an UNIQUE NAME, don\'t keep the default.', 'gazeta')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Caching Expiration', 'gazeta'), 'param_name' => 'expiration', 'value' => '300', 'description' => __('Time until expiration in seconds from now, or 0 for never expires. Ex: For one day, the expiration value would be: (60 * 60 * 24).', 'gazeta')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Columns', 'gazeta'), 'param_name' => 'columns', 'value' => 3, 'description' => __('Column number of the list.', 'gazeta')), array('type' => 'textfield', 'heading' => __('Thumbnail size', 'gazeta'), 'param_name' => 'thumbnail_size', 'description' => sprintf(__('Enter image size. Example: "thumbnail", "medium", "large", "full" or other sizes defined by current theme size: <strong>%s</strong>".', 'gazeta'), implode(", ", gazeta_get_thumbnail_image_sizes())), 'value' => 'image-370-243'), array('type' => 'checkbox', 'holder' => 'div', 'class' => '', 'param_name' => 'ignore_sticky_posts', 'value' => array(__('Ignore Sticky Posts', 'gazeta') => 'yes')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Post Format', 'gazeta'), 'param_name' => 'post_format', 'description' => __('Specify Post Format to retrieve (post-format-standard, post-format-audio, post-format-gallery,post-format-image,post-format-video), leave blank for all.', 'gazeta')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Author', 'gazeta'), 'param_name' => 'author__in', 'description' => __('Specify Author to retrieve, use author id, separated by comma(,)', 'gazeta')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Post Tags', 'gazeta'), 'param_name' => 'post_tags', 'description' => sprintf(__('Specify Post Tags to retrieve, use %s, separated by comma(,).', 'gazeta'), '<a href="' . admin_url('edit-tags.php?taxonomy=post_tag') . '">' . __('Tag Slugs', 'gazeta') . '</a>')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Categories', 'gazeta'), 'param_name' => 'categories', 'description' => sprintf(__('Specify Post Categories to retrieve, use %s, separated by comma(,).', 'gazeta'), '<a href="' . admin_url('edit-tags.php?taxonomy=category') . '">' . __('Category IDs', 'gazeta') . '</a>')), array('type' => 'orderby', 'holder' => 'div', 'class' => '', 'heading' => __('Order by', 'gazeta'), 'param_name' => 'orderby', 'value' => 'ID'), array('type' => 'order', 'holder' => 'div', 'class' => '', 'heading' => __('Order', 'gazeta'), 'param_name' => 'order', 'value' => 'DESC'), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Show Posts:', 'gazeta'), 'param_name' => 'posts_per_page', 'value' => get_option('posts_per_page')), array('type' => 'textfield', 'heading' => __('Extra class name', 'gazeta'), 'param_name' => 'el_class', '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.', 'gazeta')))); if (function_exists('vc_map')) { vc_map($args); } }
function gazeta_map_aside_posts_shortcode() { // add the shortcode. add_shortcode('gazeta_aside_posts', 'gazeta_aside_posts_shortcode'); // map the widget. $args = array('name' => __('Aside Posts Widget', 'gazeta'), 'base' => 'gazeta_aside_posts', 'category' => __('WordPress Widgets', 'gazeta'), 'class' => 'gazeta', 'icon' => 'gazeta', 'description' => __('Display the Aside Posts widget.', 'gazeta'), 'params' => array(array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Heading', 'gazeta'), 'param_name' => 'title'), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('ID', 'gazeta'), 'param_name' => 'id', 'value' => 'aside-posts-' . rand(1000, 9999), 'description' => __('<strong>IMPORTANT!</strong> You should change to an UNIQUE NAME, don\'t keep the default.', 'gazeta')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Caching Expiration', 'gazeta'), 'param_name' => 'expiration', 'value' => '300', 'description' => __('Time until expiration in seconds from now, or 0 for never expires. Ex: For one day, the expiration value would be: (60 * 60 * 24).', 'gazeta')), array('type' => 'checkbox', 'holder' => 'div', 'class' => '', 'param_name' => 'ignore_sticky_posts', 'value' => array(__('Ignore Sticky Posts', 'gazeta') => 'on')), array('type' => 'checkbox', 'holder' => 'div', 'class' => '', 'param_name' => 'shows_thumbnail_image', 'value' => array(__('Shows Thumbnail Image', 'gazeta') => 'on')), array('type' => 'textfield', 'heading' => __('Thumbnail size', 'gazeta'), 'param_name' => 'thumbnail_size', 'description' => sprintf(__('Enter image size. Example: "thumbnail", "medium", "large", "full" or other sizes defined by current theme size: <strong>%s</strong>".', 'gazeta'), implode(", ", gazeta_get_thumbnail_image_sizes())), 'value' => 'image-110-81', 'dependency' => array('element' => 'shows_thumbnail_image', 'value' => 'on', 'compare' => '=')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Author', 'gazeta'), 'param_name' => 'author__in', 'description' => __('Specify Author to retrieve, use author id, separated by comma(,)', 'gazeta')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Post Format', 'gazeta'), 'param_name' => 'post_format', 'description' => __('Specify Post Format to retrieve (post-format-standard, post-format-audio, post-format-gallery,post-format-image,post-format-video), leave blank for all.', 'gazeta')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Post Tags', 'gazeta'), 'param_name' => 'post_tags', 'description' => sprintf(__('Specify Post Tags to retrieve, use %s, separated by comma(,).', 'gazeta'), '<a href="' . admin_url('edit-tags.php?taxonomy=post_tag') . '">' . __('Tag Slugs', 'gazeta') . '</a>')), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Category', 'gazeta'), 'param_name' => 'post_categories', 'description' => sprintf(__('Specify Post Categories to retrieve, use %s, separated by comma(,).', 'gazeta'), '<a href="' . admin_url('edit-tags.php?taxonomy=category') . '">' . __('Category IDs', 'gazeta') . '</a>')), array('type' => 'orderby', 'holder' => 'div', 'class' => '', 'heading' => __('Order by', 'gazeta'), 'param_name' => 'orderby'), array('type' => 'order', 'holder' => 'div', 'class' => '', 'heading' => __('Order', 'gazeta'), 'param_name' => 'order'), array('type' => 'textfield', 'holder' => 'div', 'class' => '', 'heading' => __('Show Posts:', 'gazeta'), 'param_name' => 'posts_per_page', 'value' => '5'))); if (function_exists('vc_map')) { vc_map($args); } }
function form($instance) { $defaults = array('title' => __('Recent Posts', 'gazeta'), 'expiration' => 300, 'thumbnail_size' => 'image-370-243', 'layout' => 'classic', 'post_format' => '', 'post_tags' => '', 'post_categories' => '', 'ignore_sticky_posts' => 'on', 'category' => '', 'orderby' => 'ID', 'order' => 'DESC', 'posts_per_page' => 5); $instance = wp_parse_args((array) $instance, $defaults); ?> <p> <label for="<?php echo esc_attr($this->get_field_id('title')); ?> "><?php _e('Title:', 'gazeta'); ?> </label> <input id="<?php echo esc_attr($this->get_field_id('title')); ?> " name="<?php echo esc_attr($this->get_field_name('title')); ?> " value="<?php echo esc_attr($instance['title']); ?> " style="width:100%;" /> </p> <p> <label for="<?php echo $this->get_field_id("expiration"); ?> "><?php _e('Caching Expiration', 'gazeta'); ?> </label> <input id="<?php echo $this->get_field_id("expiration"); ?> " name="<?php echo $this->get_field_name("expiration"); ?> " type="text" value="<?php echo esc_attr($instance["expiration"]); ?> " style="width:100%;"/> <small><?php _e('Time until expiration in seconds from now, or 0 for never expires. Ex: For one day, the expiration value would be: (60 * 60 * 24).', 'gazeta'); ?> </small> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('thumbnail_size')); ?> "><?php _e('Thumbnail Size:', 'gazeta'); ?> </label> <input id="<?php echo esc_attr($this->get_field_id('thumbnail_size')); ?> " name="<?php echo esc_attr($this->get_field_name('thumbnail_size')); ?> " value="<?php echo esc_attr($instance['thumbnail_size']); ?> " style="width:100%;" /> <small><?php printf(__('Enter image size. Example: "thumbnail", "medium", "large", "full" or other sizes defined by current theme size: <strong>%s</strong>".', 'gazeta'), implode(", ", gazeta_get_thumbnail_image_sizes())); ?> </small> </p> <p> <label for="<?php echo $this->get_field_id("post_format"); ?> "><?php _e('Post Format', 'gazeta'); ?> </label> <input id="<?php echo $this->get_field_id("post_format"); ?> " name="<?php echo $this->get_field_name("post_format"); ?> " type="text" value="<?php echo esc_attr($instance["post_format"]); ?> " style="width:100%;"/> <small><?php _e('Specify Post Format to retrieve (post-format-standard, post-format-audio, post-format-gallery,post-format-image,post-format-video), leave blank for all.', 'gazeta'); ?> </small> </p> <p> <label for="<?php echo $this->get_field_id("post_tags"); ?> "><?php _e('Post Tags', 'gazeta'); ?> </label> <input id="<?php echo $this->get_field_id("post_tags"); ?> " name="<?php echo $this->get_field_name("post_tags"); ?> " type="text" value="<?php echo esc_attr($instance["post_tags"]); ?> " style="width:100%;"/> <small><?php printf(__('Specify Post Tags to retrieve, use %s, separated by comma(,).', 'gazeta'), '<a href="' . admin_url('edit-tags.php?taxonomy=post_tag') . '">' . __('Tag Slugs', 'gazeta') . '</a>'); ?> </small> </p> <p> <label for="<?php echo $this->get_field_id("post_categories"); ?> "><?php _e('Post Categories', 'gazeta'); ?> </label> <input id="<?php echo $this->get_field_id("post_categories"); ?> " name="<?php echo $this->get_field_name("post_categories"); ?> " type="text" value="<?php echo esc_attr($instance["post_categories"]); ?> " style="width:100%;"/> <small><?php printf(__('Specify Post Categories to retrieve, use %s, separated by comma(,).', 'gazeta'), '<a href="' . admin_url('edit-tags.php?taxonomy=category') . '">' . __('Category IDs', 'gazeta') . '</a>'); ?> </small> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('ignore_sticky_posts')); ?> "><?php _e('Ignore Sticky Posts:', 'gazeta'); ?> </label> <input <?php checked('on', esc_attr($instance['ignore_sticky_posts']), true); ?> type="checkbox" id="<?php echo esc_attr($this->get_field_id('ignore_sticky_posts')); ?> " name="<?php echo esc_attr($this->get_field_name('ignore_sticky_posts')); ?> "/> </p> <?php if (function_exists('gazeta_post_orderby')) { ?> <p> <label for="<?php echo esc_attr($this->get_field_id('orderby')); ?> "><?php _e('Order by:', 'gazeta'); ?> </label> <select style="width:100%;" id="<?php echo esc_attr($this->get_field_id('orderby')); ?> " name="<?php echo esc_attr($this->get_field_name('orderby')); ?> "> <?php foreach (gazeta_post_orderby() as $key => $value) { ?> <option <?php selected(esc_attr($instance['orderby']), esc_attr($key), true); ?> value="<?php print esc_attr($key); ?> "><?php print esc_attr($value); ?> </option> <?php } ?> </select> </p> <?php } ?> <?php if (function_exists('gazeta_post_order')) { ?> <p> <label for="<?php echo esc_attr($this->get_field_id('order')); ?> "><?php _e('Order:', 'gazeta'); ?> </label> <select style="width:100%;" id="<?php echo esc_attr($this->get_field_id('order')); ?> " name="<?php echo esc_attr($this->get_field_name('order')); ?> "> <?php foreach (gazeta_post_order() as $key => $value) { ?> <option <?php selected(esc_attr($instance['order']), esc_attr($key), true); ?> value="<?php print esc_attr($key); ?> "><?php print esc_attr($value); ?> </option> <?php } ?> </select> </p> <?php } ?> <p> <label for="<?php echo esc_attr($this->get_field_id('posts_per_page')); ?> "><?php _e('Show Posts:', 'gazeta'); ?> </label> <input id="<?php echo esc_attr($this->get_field_id('posts_per_page')); ?> " name="<?php echo esc_attr($this->get_field_name('posts_per_page')); ?> " value="<?php echo esc_attr($instance['posts_per_page']); ?> " style="width:100%;" /> </p> <p> <?php printf(__('Need more filters? check out %s filter hook.', 'gazeta'), '<code>gazeta_mega_posts/args</code>'); ?> </p> <?php }