function form($instance) { ?> <p><label for="<?php echo $this->get_field_id('posts_cat'); ?> "><?php _e('Category', 'genesis'); ?> :</label> <?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat'), 'selected' => $instance['posts_cat'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("All Categories", 'genesis'), 'hide_empty' => '0')); ?> </p> <?php $instance['posts_num'] = !empty($instance['posts_num']) ? $instance['posts_num'] : 1; ?> <p><label for="<?php echo $this->get_field_id('posts_num'); ?> "><?php _e('Number of Posts to Show', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_num'); ?> " name="<?php echo $this->get_field_name('posts_num'); ?> " value="<?php echo esc_attr($instance['posts_num']); ?> " size="2" /><span class="howto">(choose number between 1 and 6)</span></p> <?php $instance['posts_offset'] = !empty($instance['posts_offset']) ? $instance['posts_offset'] : 0; ?> <p><label for="<?php echo $this->get_field_id('posts_offset'); ?> "><?php _e('Number of Posts to Offset', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_offset'); ?> " name="<?php echo $this->get_field_name('posts_offset'); ?> " value="<?php echo esc_attr($instance['posts_offset']); ?> " size="2" /></p> <p><label for="<?php echo $this->get_field_id('orderby'); ?> "><?php _e('Order By', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('orderby'); ?> " name="<?php echo $this->get_field_name('orderby'); ?> "> <option style="padding-right:10px;" value="date" <?php selected('date', $instance['orderby']); ?> ><?php _e('Date', 'genesis'); ?> </option> <option style="padding-right:10px;" value="title" <?php selected('title', $instance['orderby']); ?> ><?php _e('Title', 'genesis'); ?> </option> <option style="padding-right:10px;" value="parent" <?php selected('parent', $instance['orderby']); ?> ><?php _e('Parent', 'genesis'); ?> </option> <option style="padding-right:10px;" value="ID" <?php selected('ID', $instance['orderby']); ?> ><?php _e('ID', 'genesis'); ?> </option> <option style="padding-right:10px;" value="comment_count" <?php selected('comment_count', $instance['orderby']); ?> ><?php _e('Comment Count', 'genesis'); ?> </option> <option style="padding-right:10px;" value="rand" <?php selected('rand', $instance['orderby']); ?> ><?php _e('Random', 'genesis'); ?> </option> </select></p> <p><label for="<?php echo $this->get_field_id('order'); ?> "><?php _e('Sort Order', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('order'); ?> " name="<?php echo $this->get_field_name('order'); ?> "> <option style="padding-right:10px;" value="DESC" <?php selected('DESC', $instance['order']); ?> ><?php _e('Descending (3, 2, 1)', 'genesis'); ?> </option> <option style="padding-right:10px;" value="ASC" <?php selected('ASC', $instance['order']); ?> ><?php _e('Ascending (1, 2, 3)', 'genesis'); ?> </option> </select></p> <hr class="div" /> <p><input id="<?php echo $this->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked(1, $instance['show_image']); ?> /> <label for="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Post Image', 'genesis'); ?> </label></p> <p><label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis'); ?> :</label> <?php $sizes = genesis_get_additional_image_sizes(); ?> <select id="<?php echo $this->get_field_id('image_size'); ?> " name="<?php echo $this->get_field_name('image_size'); ?> "> <option style="padding-right:10px;" value="thumbnail">thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <?php foreach ((array) $sizes as $name => $size) { echo '<option style="padding-right: 10px;" value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' (' . $size['width'] . 'x' . $size['height'] . ')</option>'; } ?> </select></p> <p><label for="<?php echo $this->get_field_id('image_alignment'); ?> "><?php _e('Image Alignment', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('image_alignment'); ?> "> <option style="padding-right:10px;" value="">- <?php _e('None', 'genesis'); ?> -</option> <option style="padding-right:10px;" value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option style="padding-right:10px;" value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> </select></p> <hr class="div" /> <p><input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked(1, $instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Post Title', 'genesis'); ?> </label></p> <p> <label><input type="radio" name="<?php echo $this->get_field_name('show_content'); ?> " value="" <?php checked('', $instance['show_content']); ?> /> <?php _e('Hide the Content', 'genesis'); ?> </label><br /> <label><input type="radio" name="<?php echo $this->get_field_name('show_content'); ?> " value="excerpt" <?php checked('excerpt', $instance['show_content']); ?> /> <?php _e('Show the Excerpt', 'genesis'); ?> </label><br /> <label><input type="radio" name="<?php echo $this->get_field_name('show_content'); ?> " value="content" <?php checked('content', $instance['show_content']); ?> /> <?php _e('Show the Content', 'genesis'); ?> </label><br /> <label><input type="radio" name="<?php echo $this->get_field_name('show_content'); ?> " value="content-limit" <?php checked('content-limit', $instance['show_content']); ?> /> <?php _e('Content Limit', 'genesis'); ?> </label> <input type="text" name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr(intval($instance['content_limit'])); ?> " size="3" /> <?php _e('characters', 'genesis'); ?> </p> <?php $instance['more_text'] = isset($instance['more_text']) ? $instance['more_text'] : '[Read More...]'; ?> <p><label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text (if applicable)', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /></p> <hr class="div" /> <p><input id="<?php echo $this->get_field_id('show_slider_nav'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_slider_nav'); ?> " value="1" <?php checked(1, $instance['show_slider_nav']); ?> /> <label for="<?php echo $this->get_field_id('show_slider_nav'); ?> "><?php _e('Show Slider Thumbnail Nav', 'genesis'); ?> </label></p> <hr class="div" /> <?php }
/** * Creates Widget Form * * @author Nick Croft * @since 0.1 * @version 0.5 * @param array $instance Values set in widget isntance */ function form($instance) { /** Merge with defaults */ $instance = wp_parse_args((array) $instance, $this->defaults); $sizes = genesis_get_additional_image_sizes(); $imageSize_opt['thumbnail'] = 'thumbnail (' . get_option('thumbnail_size_w') . 'x' . get_option('thumbnail_size_h') . ')'; foreach ((array) $sizes as $name => $size) { $imageSize_opt[$name] = esc_html($name) . ' (' . $size['width'] . 'x' . $size['height'] . ')'; } $columns = array('col1' => array(array('post_type' => array('label' => __('Post Type', 'gfwa'), 'description' => '', 'type' => 'post_type_select', 'save' => true, 'requires' => ''), 'page_id' => array('label' => __('Page', 'gfwa'), 'description' => '', 'type' => 'page_select', 'save' => true, 'requires' => array('post_type', 'page', false)), 'posts_term' => array('label' => __('Taxonomy and Terms', 'gfwa'), 'description' => '', 'type' => 'select_taxonomy', 'save' => false, 'requires' => array('post_type', 'page', true)), 'exclude_terms' => array('label' => sprintf(__('Exclude Terms by ID %s (comma separated list)', 'gfwa'), '<br />'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('post_type', 'page', true)), 'include_exclude' => array('label' => '', 'description' => '', 'type' => 'select', 'options' => array('' => __('Select', 'gfwa'), 'include' => __('Include', 'gfwa'), 'exclude' => __('Exclude', 'gfwa')), 'save' => true, 'requires' => array('page_id', '', false)), 'post_id' => array('label' => $instance['post_type'] . ' ' . __('ID', 'gfwa'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('include_exclude', '', true)), 'posts_num' => array('label' => __('Number of Posts to Show', 'gfwa'), 'description' => '', 'type' => 'text_small', 'save' => false, 'requires' => array('page_id', '', false)), 'posts_offset' => array('label' => __('Number of Posts to Offset', 'gfwa'), 'description' => '', 'type' => 'text_small', 'save' => false, 'requires' => array('page_id', '', false)), 'orderby' => array('label' => __('Order By', 'gfwa'), 'description' => '', 'type' => 'select', 'options' => array('date' => __('Date', 'gfwa'), 'title' => __('Title', 'gfwa'), 'parent' => __('Parent', 'gfwa'), 'ID' => __('ID', 'gfwa'), 'comment_count' => __('Comment Count', 'gfwa'), 'rand' => __('Random', 'gfwa'), 'meta_value' => __('Meta Value', 'gfwa'), 'meta_value_num' => __('Numeric Meta Value', 'gfwa')), 'save' => false, 'requires' => array('page_id', '', false)), 'order' => array('label' => __('Sort Order', 'gfwa'), 'description' => '', 'type' => 'select', 'options' => array('DESC' => __('Descending (3, 2, 1)', 'gfwa'), 'ASC' => __('Ascending (1, 2, 3)', 'gfwa')), 'save' => false, 'requires' => array('page_id', '', false)), 'meta_key' => array('label' => __('Meta Key', 'gfwa'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('page_id', '', false)), 'paged' => array('label' => __('Work with Pagination', 'gfwa'), 'description' => '', 'type' => 'checkbox', 'save' => false, 'requires' => array('post_type', 'page', true)), 'show_paged' => array('label' => __('Show Page Navigation', 'gfwa'), 'description' => '', 'type' => 'checkbox', 'save' => false, 'requires' => array('post_type', 'page', true))), array('show_gravatar' => array('label' => __('Show Author Gravatar', 'gfwa'), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => ''), 'gravatar_size' => array('label' => __('Gravatar Size', 'gfwa'), 'description' => '', 'type' => 'select', 'options' => array('45' => __('Small (45px)', 'gfwa'), '65' => __('Medium (65px)', 'gfwa'), '85' => __('Large (85px)', 'gfwa'), '125' => __('Extra Large (125px)', 'gfwa')), 'save' => false, 'requires' => array('show_gravatar', '', true)), 'link_gravatar' => array('label' => '', 'description' => '', 'type' => 'select', 'options' => array('' => __('Do not link gravatar', 'gfwa'), 'archive' => __('Link to author archive', 'gfwa'), 'website' => __('Link to author website', 'gfwa')), 'save' => false, 'requires' => array('show_gravatar', '', true)), 'gravatar_alignment' => array('label' => __('Gravatar Alignment', 'gfwa'), 'description' => '', 'type' => 'select', 'options' => array('' => __('None', 'gfwa'), 'alignleft' => __('Left', 'gfwa'), 'alignright' => __('Right', 'gfwa')), 'save' => false, 'requires' => array('show_gravatar', '', true)))), 'col2' => array(array('show_image' => array('label' => __('Show Featured Image', 'gfwa'), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => ''), 'link_image' => array('label' => '', 'description' => '', 'type' => 'select', 'options' => array('1' => __('Link Image to Post', 'gfwa'), '2' => __('Don\'t Link Image', 'gfwa')), 'save' => true, 'requires' => array('show_image', '', true)), 'link_image_field' => array('label' => __('Custom Field for Link ( Defaults to Permalink )'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('link_image', '1', false)), 'image_size' => array('label' => '', 'description' => '', 'type' => 'select', 'options' => $imageSize_opt, 'save' => false, 'requires' => array('show_image', '', true)), 'image_position' => array('label' => __('Image Placement', 'gfwa'), 'description' => '', 'type' => 'select', 'options' => array('before-title' => __('Before Title', 'gfwa'), 'after-title' => __('After Title', 'gfwa'), 'after-content' => __('After Content', 'gfwa')), 'save' => false, 'requires' => array('show_image', '', true)), 'image_alignment' => array('label' => '', 'description' => '', 'type' => 'select', 'options' => array('' => __('None', 'gfwa'), 'alignleft' => __('Left', 'gfwa'), 'alignright' => __('Right', 'gfwa'), 'aligncenter' => __('Center', 'gfwa')), 'save' => false, 'requires' => array('show_image', '', true))), array('show_title' => array('label' => __('Show Post Title', 'gfwa'), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => ''), 'title_limit' => array('label' => __('Limit title to', 'gfwa'), 'description' => __('characters', 'gfwa'), 'type' => 'text_small', 'save' => false, 'requires' => array('show_title', '', true)), 'title_cutoff' => array('label' => __('Title Cutoff Symbol', 'gfwa'), 'description' => '', 'type' => 'text_small', 'save' => false, 'requires' => array('show_title', '', true)), 'link_title' => array('label' => '', 'description' => '', 'type' => 'select', 'options' => array('1' => __('Link Title to Post', 'gfwa'), '2' => __('Don\'t Link Title', 'gfwa')), 'save' => true, 'requires' => array('show_title', '', true)), 'link_title_field' => array('label' => __('Custom Field for Link ( Defaults to Permalink )'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('link_title', '1', false)), 'show_byline' => array('label' => __('Show Post Info', 'gfwa'), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => ''), 'post_info' => array('label' => '', 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('show_byline', '', true)), 'show_content' => array('label' => __('Content Type', 'gfwa'), 'description' => '', 'type' => 'select', 'options' => array('content' => __('Show Content', 'gfwa'), 'excerpt' => __('Show Excerpt', 'gfwa'), 'content-limit' => __('Show Content Limit', 'gfwa'), '' => __('No Content', 'gfwa')), 'save' => true, 'requires' => ''), 'content_limit' => array('label' => __('Limit content to', 'gfwa'), 'description' => __('characters', 'gfwa'), 'type' => 'text_small', 'save' => false, 'requires' => array('show_content', 'content-limit', false)), 'show_archive_line' => array('label' => __('Show Post Meta', 'gfwa'), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => array('post_type', 'page', true)), 'post_meta' => array('label' => '', 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('show_archive_line', '', true)), 'more_text' => array('label' => __('More Text (if applicable)', 'gfwa'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => '')), array('extra_posts' => array('label' => __('Display List of Additional Posts', 'gfwa'), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => array('post_type', 'page', true)), 'extra_title' => array('label' => __('Title', 'gfwa'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('extra_posts', '', true)), 'extra_num' => array('label' => __('Number of Posts to Show', 'gfwa'), 'description' => '', 'type' => 'text_small', 'save' => false, 'requires' => array('extra_posts', '', true)), 'extra_format' => array('label' => __('Extra Post Format', 'gfwa'), 'description' => '', 'type' => 'select', 'options' => array('ul' => __('Unordered List', 'gfwa'), 'ol' => __('Ordered List', 'gfwa'), 'drop_down' => __('Drop Down', 'gfwa')), 'save' => false, 'requires' => array('extra_posts', '', true))), array('more_from_category' => array('label' => __('Show Category Archive Link', 'gfwa'), 'description' => '', 'type' => 'checkbox', 'save' => true, 'requires' => array('post_type', 'page', true)), 'more_from_category_text' => array('label' => __('Link Text', 'gfwa'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('more_from_category', '', true)), 'archive_link' => array('label' => __('Fill in this value with a URL if you wish to display an archive link when showing all terms or to override the normal archive link to another URL', 'gfwa'), 'description' => '', 'type' => 'text', 'save' => false, 'requires' => array('more_from_category', '', true))), array('custom_field' => array('label' => __('Instance Identification Field', 'gfwa'), 'description' => __('Fill in this field if you need to test against an $instance value not included in the form', 'gfwa'), 'type' => 'text', 'save' => false, 'requires' => '')))); echo '<p><label for="' . $this->get_field_id('title') . '">' . __('Title', 'gfwa') . ':</label> <input type="text" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" value="' . esc_attr($instance['title']) . '" style="width:99%;" /></p>'; foreach ($columns as $column => $boxes) { if ('col1' == $column) { echo '<div style="float: left; width: 250px;">'; } else { echo '<div style="float: right; width: 250px;">'; } foreach ($boxes as $box) { echo '<div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin-bottom: 5px;">'; foreach ($box as $fieldID => $args) { $class = $args['save'] ? 'class="widget-control-save" ' : ''; $style = $args['requires'] ? ' style="' . gfwa_get_display_option($instance, $args['requires'][0], $args['requires'][1], $args['requires'][2]) . '"' : ''; switch ($args['type']) { case 'post_type_select': echo '<p><label for="' . $this->get_field_id($fieldID) . '">' . $args['label'] . ':</label> <select ' . $class . 'id="' . $this->get_field_id($fieldID) . '" name="' . $this->get_field_name($fieldID) . '">'; $args = array('public' => true); $output = 'names'; $operator = 'and'; $post_types = get_post_types($args, $output, $operator); $post_types = array_filter($post_types, 'gfwa_exclude_post_types'); foreach ($post_types as $post_type) { echo '<option style="padding-right:10px;" value="' . esc_attr($post_type) . '" ' . selected(esc_attr($post_type), $instance['post_type'], false) . '>' . esc_attr($post_type) . '</option>'; } echo '<option style="padding-right:10px;" value="any" ' . selected('any', $instance['post_type'], false) . '>' . __('any', 'gfwa') . '</option>'; echo '</select></p>'; break; case 'page_select': echo '<p' . $style . '><label for="' . $this->get_field_id($fieldID) . '">' . $args['label'] . ':</label> <select ' . $class . ' id="' . $this->get_field_id($fieldID) . '" name="' . $this->get_field_name($fieldID) . '"> <option value="" ' . selected('', $instance['page_id'], false) . '>' . attribute_escape(__('Select page', 'gfwa')) . '</option>'; $pages = get_pages(); foreach ($pages as $page) { echo '<option style="padding-right:10px;" value="' . esc_attr($page->ID) . '" ' . selected(esc_attr($page->ID), $instance['page_id'], false) . '>' . esc_attr($page->post_title) . '</option>'; } echo '</select> </p>'; break; case 'select_taxonomy': echo '<p' . $style . '"><label for="' . $this->get_field_id($fieldID) . '">' . $args['label'] . ':</label> <select id="' . $this->get_field_id($fieldID) . '" name="' . $this->get_field_name($fieldID) . '"> <option style="padding-right:10px;" value="" ' . selected('', $instance['posts_term'], false) . '>' . __('All Taxonomies and Terms', 'gfwa') . '</option>'; $taxonomies = get_taxonomies(array('public' => true), 'objects'); $taxonomies = array_filter($taxonomies, 'gfwa_exclude_taxonomies'); $test = get_taxonomies(array('public' => true), 'objects'); foreach ($taxonomies as $taxonomy) { $query_label = ''; if (!empty($taxonomy->query_var)) { $query_label = $taxonomy->query_var; } else { $query_label = $taxonomy->name; } echo '<optgroup label="' . esc_attr($taxonomy->labels->name) . '"> <option style="margin-left: 5px; padding-right:10px;" value="' . esc_attr($query_label) . '" ' . selected(esc_attr($query_label), $instance['posts_term'], false) . '>' . $taxonomy->labels->all_items . '</option>'; $terms = get_terms($taxonomy->name, 'orderby=name&hide_empty=1'); foreach ($terms as $term) { echo '<option style="margin-left: 8px; padding-right:10px;" value="' . esc_attr($query_label) . ',' . $term->slug . '" ' . selected(esc_attr($query_label) . ',' . $term->slug, $instance['posts_term'], false) . '>-' . esc_attr($term->name) . '</option>'; } echo '</optgroup>'; } echo '</select></p>'; break; case 'text': echo $args['description'] ? '<p>' . $args['description'] . '</p>' : ''; echo '<p' . $style . '><label for="' . $this->get_field_id($fieldID) . '">' . $args['label'] . ':</label> <input type="text" id="' . $this->get_field_id($fieldID) . '" name="' . $this->get_field_name($fieldID) . '" value="' . esc_attr($instance[$fieldID]) . '" style="width:95%;" /></p>'; break; case 'text_small': echo '<p' . $style . '><label for="' . $this->get_field_id($fieldID) . '">' . $args['label'] . ':</label> <input type="text" id="' . $this->get_field_id($fieldID) . '" name="' . $this->get_field_name($fieldID) . '" value="' . esc_attr($instance[$fieldID]) . '" size="2" />' . $args['description'] . '</p>'; break; case 'select': echo '<p' . $style . '"><label for="' . $this->get_field_id($fieldID) . '">' . $args['label'] . ' </label> <select ' . $class . 'id="' . $this->get_field_id($fieldID) . '" name="' . $this->get_field_name($fieldID) . '">'; foreach ($args['options'] as $value => $label) { echo '<option style="padding-right:10px;" value="' . $value . '" ' . selected($value, $instance[$fieldID], false) . '>' . $label . '</option>'; } echo '</select></p>'; break; case 'checkbox': echo '<p' . $style . '><input ' . $class . 'id="' . $this->get_field_id($fieldID) . '" type="checkbox" name="' . $this->get_field_name($fieldID) . '" value="1" ' . checked(1, $instance[$fieldID], false) . '/> <label for="' . $this->get_field_id($fieldID) . '">' . $args['label'] . '</label></p>'; break; } } echo '</div>'; } echo '</div>'; } }
/** * Echo the settings update form. * * @since 0.1.8 * * @param array $instance Current settings */ function form($instance) { //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " class="widefat" /> </p> <div class="genesis-widget-column"> <div class="genesis-widget-column-box genesis-widget-column-box-top"> <p> <label for="<?php echo $this->get_field_id('posts_cat'); ?> "><?php _e('Category', 'genesis'); ?> :</label> <?php $categories_args = array('name' => $this->get_field_name('posts_cat'), 'selected' => $instance['posts_cat'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __('All Categories', 'genesis'), 'hide_empty' => '0'); wp_dropdown_categories($categories_args); ?> </p> <p> <label for="<?php echo $this->get_field_id('posts_num'); ?> "><?php _e('Number of Posts to Show', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_num'); ?> " name="<?php echo $this->get_field_name('posts_num'); ?> " value="<?php echo esc_attr($instance['posts_num']); ?> " size="2" /> </p> <p> <label for="<?php echo $this->get_field_id('posts_offset'); ?> "><?php _e('Number of Posts to Offset', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_offset'); ?> " name="<?php echo $this->get_field_name('posts_offset'); ?> " value="<?php echo esc_attr($instance['posts_offset']); ?> " size="2" /> </p> <p> <label for="<?php echo $this->get_field_id('orderby'); ?> "><?php _e('Order By', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('orderby'); ?> " name="<?php echo $this->get_field_name('orderby'); ?> "> <option value="date" <?php selected('date', $instance['orderby']); ?> ><?php _e('Date', 'genesis'); ?> </option> <option value="title" <?php selected('title', $instance['orderby']); ?> ><?php _e('Title', 'genesis'); ?> </option> <option value="parent" <?php selected('parent', $instance['orderby']); ?> ><?php _e('Parent', 'genesis'); ?> </option> <option value="ID" <?php selected('ID', $instance['orderby']); ?> ><?php _e('ID', 'genesis'); ?> </option> <option value="comment_count" <?php selected('comment_count', $instance['orderby']); ?> ><?php _e('Comment Count', 'genesis'); ?> </option> <option value="rand" <?php selected('rand', $instance['orderby']); ?> ><?php _e('Random', 'genesis'); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('order'); ?> "><?php _e('Sort Order', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('order'); ?> " name="<?php echo $this->get_field_name('order'); ?> "> <option value="DESC" <?php selected('DESC', $instance['order']); ?> ><?php _e('Descending (3, 2, 1)', 'genesis'); ?> </option> <option value="ASC" <?php selected('ASC', $instance['order']); ?> ><?php _e('Ascending (1, 2, 3)', 'genesis'); ?> </option> </select> </p> <p> <input id="<?php echo $this->get_field_id('exclude_displayed'); ?> " type="checkbox" name="<?php echo $this->get_field_name('exclude_displayed'); ?> " value="1" <?php checked($instance['exclude_displayed']); ?> /> <label for="<?php echo $this->get_field_id('exclude_displayed'); ?> "><?php _e('Exclude Previously Displayed Posts?', 'genesis'); ?> </label> </p> </div> <div class="genesis-widget-column-box"> <p> <label for="<?php echo $this->get_field_id('num_cols'); ?> "><?php _be('Number cols', 'bbessentials'); ?> :</label> <select id="<?php echo $this->get_field_id('num_cols'); ?> " name="<?php echo $this->get_field_name('num_cols'); ?> "> <option value="1" <?php selected('1', $instance['num_cols']); ?> >- 1 -</option> <option value="2" <?php selected('2', $instance['num_cols']); ?> >- 2 -</option> <option value="3" <?php selected('3', $instance['num_cols']); ?> >- 3 -</option> <option value="4" <?php selected('4', $instance['num_cols']); ?> >- 4 -</option> <option value="5" <?php selected('5', $instance['num_cols']); ?> >- 5 -</option> <option value="6" <?php selected('6', $instance['num_cols']); ?> >- 6 -</option> </select> </p> <p> <label for="<?php echo $this->get_field_id('layout_style'); ?> "><?php _be('Layout style', 'bbessentials'); ?> :</label> <select id="<?php echo $this->get_field_id('layout_style'); ?> " name="<?php echo $this->get_field_name('layout_style'); ?> "> <option value="style1" <?php selected('style1', $instance['layout_style']); ?> >- style 1 -</option> <option value="style2" <?php selected('style2', $instance['layout_style']); ?> >- style 2 -</option> <option value="style3" <?php selected('style3', $instance['layout_style']); ?> >- style 3 -</option> <option value="style4" <?php selected('style4', $instance['layout_style']); ?> >- style 4 -</option> <option value="style5" <?php selected('style5', $instance['layout_style']); ?> >- style 5 -</option> </select> </p> <p> <input id="<?php echo $this->get_field_id('permalink_button'); ?> " type="checkbox" name="<?php echo $this->get_field_name('permalink_button'); ?> " value="1" <?php checked($instance['permalink_button']); ?> /> <label for="<?php echo $this->get_field_id('permalink_button'); ?> "><?php _be('Show permalink button', 'bbessentials'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('permalink_button_style'); ?> "><?php _be('Permalink Button Style', 'bbessentials'); ?> :</label> <select id="<?php echo $this->get_field_id('permalink_button_style'); ?> " name="<?php echo $this->get_field_name('permalink_button_style'); ?> "> <option value="flbuilder" <?php selected('flbuilder', $instance['permalink_button_style']); ?> >FL Builder</option> <option value="themed" <?php selected('themed', $instance['permalink_button_style']); ?> ><?php _be('Themed style', 'bbessentials'); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('permalink_button_class'); ?> "><?php _be('Permalink Button Class', 'bbessentials'); ?> :</label> <select id="<?php echo $this->get_field_id('permalink_button_class'); ?> " name="<?php echo $this->get_field_name('permalink_button_class'); ?> "> <option value="default" <?php selected('default', $instance['permalink_button_class']); ?> ><?php _e('Default', 'bbessentials'); ?> </option> <option value="primary" <?php selected('primary', $instance['permalink_button_class']); ?> ><?php _e('Primary', 'bbessentials'); ?> </option> <option value="success" <?php selected('success', $instance['permalink_button_class']); ?> ><?php _e('Success', 'bbessentials'); ?> </option> <option value="info" <?php selected('info', $instance['permalink_button_class']); ?> ><?php _be('Info', 'bbessentials'); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('permalink_button_align'); ?> "><?php _be('Permalink Button Align', 'bbessentials'); ?> :</label> <select id="<?php echo $this->get_field_id('permalink_button_align'); ?> " name="<?php echo $this->get_field_name('permalink_button_align'); ?> "> <option value="left" <?php selected('default', $instance['permalink_button_align']); ?> ><?php _e('Left', 'bbessentials'); ?> </option> <option value="center" <?php selected('center', $instance['permalink_button_align']); ?> ><?php _e('Center', 'bbessentials'); ?> </option> <option value="right" <?php selected('right', $instance['permalink_button_align']); ?> ><?php _e('Right', 'bbessentials'); ?> </option> </select> </p> </div> <div class="genesis-widget-column-box"> <p> <input id="<?php echo $this->get_field_id('show_gravatar'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_gravatar'); ?> " value="1" <?php checked($instance['show_gravatar']); ?> /> <label for="<?php echo $this->get_field_id('show_gravatar'); ?> "><?php _e('Show Author Gravatar', 'genesis'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('gravatar_size'); ?> "><?php _e('Gravatar Size', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('gravatar_size'); ?> " name="<?php echo $this->get_field_name('gravatar_size'); ?> "> <option value="45" <?php selected(45, $instance['gravatar_size']); ?> ><?php _e('Small (45px)', 'genesis'); ?> </option> <option value="65" <?php selected(65, $instance['gravatar_size']); ?> ><?php _e('Medium (65px)', 'genesis'); ?> </option> <option value="85" <?php selected(85, $instance['gravatar_size']); ?> ><?php _e('Large (85px)', 'genesis'); ?> </option> <option value="125" <?php selected(105, $instance['gravatar_size']); ?> ><?php _e('Extra Large (125px)', 'genesis'); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('gravatar_alignment'); ?> "><?php _e('Gravatar Alignment', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('gravatar_alignment'); ?> " name="<?php echo $this->get_field_name('gravatar_alignment'); ?> "> <option value="alignnone">- <?php _e('None', 'genesis'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $instance['gravatar_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option value="alignright" <?php selected('alignright', $instance['gravatar_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> </select> </p> </div> <div class="genesis-widget-column-box"> <p> <input id="<?php echo $this->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked($instance['show_image']); ?> /> <label for="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Featured Image', 'genesis'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('image_size'); ?> " class="genesis-image-size-selector" name="<?php echo $this->get_field_name('image_size'); ?> "> <option value="thumbnail" <?php echo selected('thumbnail', $instance['image_size'], FALSE); ?> >thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <option value="medium" <?php echo selected('medium', $instance['image_size'], FALSE); ?> >medium (<?php echo get_option('medium_size_w'); ?> x<?php echo get_option('medium_size_h'); ?> )</option> <option value="large" <?php echo selected('large', $instance['image_size'], FALSE); ?> >large (<?php echo get_option('large_size_w'); ?> x<?php echo get_option('large_size_h'); ?> )</option> <?php $sizes = genesis_get_additional_image_sizes(); foreach ((array) $sizes as $name => $size) { echo '<option value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' ( ' . $size['width'] . 'x' . $size['height'] . ' )</option>'; } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('image_alignment'); ?> "><?php _e('Image Alignment', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('image_alignment'); ?> "> <option value="alignnone">- <?php _e('None', 'genesis'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> <option value="aligncenter" <?php selected('aligncenter', $instance['image_alignment']); ?> ><?php _e('Center', 'genesis'); ?> </option> </select> </p> </div> </div> <div class="genesis-widget-column genesis-widget-column-right"> <div class="genesis-widget-column-box genesis-widget-column-box-top"> <p> <input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked($instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Post Title', 'genesis'); ?> </label> </p> <p> <input id="<?php echo $this->get_field_id('show_byline'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_byline'); ?> " value="1" <?php checked($instance['show_byline']); ?> /> <label for="<?php echo $this->get_field_id('show_byline'); ?> "><?php _e('Show Post Info', 'genesis'); ?> </label> <input type="text" id="<?php echo $this->get_field_id('post_info'); ?> " name="<?php echo $this->get_field_name('post_info'); ?> " value="<?php echo esc_attr($instance['post_info']); ?> " class="widefat" /> </p> <p> <label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Content Type', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('show_content'); ?> " name="<?php echo $this->get_field_name('show_content'); ?> "> <option value="content" <?php selected('content', $instance['show_content']); ?> ><?php _e('Show Content', 'genesis'); ?> </option> <option value="excerpt" <?php selected('excerpt', $instance['show_content']); ?> ><?php _e('Show Excerpt', 'genesis'); ?> </option> <option value="content-limit" <?php selected('content-limit', $instance['show_content']); ?> ><?php _e('Show Content Limit', 'genesis'); ?> </option> <option value="" <?php selected('', $instance['show_content']); ?> ><?php _e('No Content', 'genesis'); ?> </option> </select> <br /> <label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Limit content to', 'genesis'); ?> <input type="text" id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr(intval($instance['content_limit'])); ?> " size="3" /> <?php _e('characters', 'genesis'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text (if applicable)', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /> </p> </div> <div class="genesis-widget-column-box"> <p><?php _e('To display an unordered list of more posts from this category, please fill out the information below', 'genesis'); ?> :</p> <p> <label for="<?php echo $this->get_field_id('extra_title'); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('extra_title'); ?> " name="<?php echo $this->get_field_name('extra_title'); ?> " value="<?php echo esc_attr($instance['extra_title']); ?> " class="widefat" /> </p> <p> <label for="<?php echo $this->get_field_id('extra_num'); ?> "><?php _e('Number of Posts to Show', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('extra_num'); ?> " name="<?php echo $this->get_field_name('extra_num'); ?> " value="<?php echo esc_attr($instance['extra_num']); ?> " size="2" /> </p> </div> <div class="genesis-widget-column-box"> <p> <input id="<?php echo $this->get_field_id('more_from_category'); ?> " type="checkbox" name="<?php echo $this->get_field_name('more_from_category'); ?> " value="1" <?php checked($instance['more_from_category']); ?> /> <label for="<?php echo $this->get_field_id('more_from_category'); ?> "><?php _e('Show Category Archive Link', 'genesis'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('more_from_category_text'); ?> "><?php _e('Link Text', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_from_category_text'); ?> " name="<?php echo $this->get_field_name('more_from_category_text'); ?> " value="<?php echo esc_attr($instance['more_from_category_text']); ?> " class="widefat" /> </p> </div> </div> <?php }
/** Form output */ function form($instance) { // ensure value exists $instance = wp_parse_args((array) $instance, array('title' => '', 'posts_cat_1' => '', 'posts_cat_2' => '', 'posts_cat_3' => '', 'posts_cat_4' => '', 'posts_cat_5' => '', 'posts_cat_6' => '', 'posts_cat_7' => '', 'posts_cat_8' => '', 'posts_cat_9' => '', 'posts_cat_10' => '', 'show_image' => 0, 'image_alignment' => '', 'image_size' => '', 'show_title' => 0, 'show_byline' => 0, 'post_info' => '[post_date] ' . __('By', 'genesis') . ' [post_author_posts_link] [post_comments]', 'show_content' => 'excerpt', 'content_limit' => '', 'more_text' => __('[Read More...]', 'genesis'))); ?> <p><label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " style="width:95%;" /></p> <div class="genesis-widget-column"> <div class="genesis-widget-column-box genesis-widget-column-box-top"> <p><span class="description">Choose up to 8 categories to pull posts from. Each category you choose will represent a single tab.</span></p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_1'), 'selected' => $instance['posts_cat_1'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_2'), 'selected' => $instance['posts_cat_2'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_3'), 'selected' => $instance['posts_cat_3'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_4'), 'selected' => $instance['posts_cat_4'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_5'), 'selected' => $instance['posts_cat_5'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_6'), 'selected' => $instance['posts_cat_6'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_7'), 'selected' => $instance['posts_cat_7'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_8'), 'selected' => $instance['posts_cat_8'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_9'), 'selected' => $instance['posts_cat_9'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat_10'), 'selected' => $instance['posts_cat_10'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("- None Selected -", 'genesis'), 'hide_empty' => '0')); ?> </p> </div> </div> <div class="genesis-widget-column genesis-widget-column-right"> <div class="genesis-widget-column-box genesis-widget-column-box-top"> <p><input id="<?php echo $this->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked(1, $instance['show_image']); ?> /> <label for="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Featured Image', 'genesis'); ?> </label></p> <p><label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis'); ?> :</label> <?php $sizes = genesis_get_additional_image_sizes(); ?> <select id="<?php echo $this->get_field_id('image_size'); ?> " name="<?php echo $this->get_field_name('image_size'); ?> "> <option value="thumbnail">thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <?php foreach ((array) $sizes as $name => $size) { echo '<option value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' (' . $size['width'] . 'x' . $size['height'] . ')</option>'; } ?> </select></p> <p><label for="<?php echo $this->get_field_id('image_alignment'); ?> "><?php _e('Image Alignment', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('image_alignment'); ?> "> <option value="">- <?php _e('None', 'genesis'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> </select></p> </div> <div class="genesis-widget-column-box"> <p><input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked(1, $instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Post Title', 'genesis'); ?> </label></p> <p><input id="<?php echo $this->get_field_id('show_byline'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_byline'); ?> " value="1" <?php checked(1, $instance['show_byline']); ?> /> <label for="<?php echo $this->get_field_id('show_byline'); ?> "><?php _e('Show Post Info', 'genesis'); ?> </label> <input type="text" id="<?php echo $this->get_field_id('post_info'); ?> " name="<?php echo $this->get_field_name('post_info'); ?> " value="<?php echo esc_attr($instance['post_info']); ?> " class="widefat" /> </p> <p><label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Content Type', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('show_content'); ?> " name="<?php echo $this->get_field_name('show_content'); ?> "> <option value="content" <?php selected('content', $instance['show_content']); ?> ><?php _e('Show Content', 'genesis'); ?> </option> <option value="excerpt" <?php selected('excerpt', $instance['show_content']); ?> ><?php _e('Show Excerpt', 'genesis'); ?> </option> <option value="content-limit" <?php selected('content-limit', $instance['show_content']); ?> ><?php _e('Show Content Limit', 'genesis'); ?> </option> <option value="" <?php selected('', $instance['show_content']); ?> ><?php _e('No Content', 'genesis'); ?> </option> </select> <br /><label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Limit content to', 'genesis'); ?> </label> <input type="text" id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr(intval($instance['content_limit'])); ?> " size="3" /> <?php _e('characters', 'genesis'); ?> </p> <p><label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text (if applicable)', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /></p> </div> </div> <?php }
/** * Outputs the image settings. * * @access public * @return void */ public function image_options() { ?> <p> <input id="<?php echo $this->_widget_object->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo esc_attr($this->_widget_object->get_field_name('show_image')); ?> " value="1"<?php checked($this->_instance['show_image']); ?> /> <label for="<?php echo esc_attr($this->_widget_object->get_field_id('show_image')); ?> "><?php _e('Show Featured Image', 'genesis'); ?> </label> </p> <p> <label for="<?php echo esc_attr($this->_widget_object->get_field_id('image_size')); ?> "><?php _e('Image Size', 'genesis-author-pro'); ?> :</label> <select id="<?php echo esc_attr($this->_widget_object->get_field_id('image_size')); ?> " class="genesis-image-size-selector" name="<?php echo esc_attr($this->_widget_object->get_field_name('image_size')); ?> "> <option value="thumbnail">thumbnail (<?php echo absint(get_option('thumbnail_size_w')); ?> x<?php echo absint(get_option('thumbnail_size_h')); ?> )</option> <?php $sizes = genesis_get_additional_image_sizes(); foreach ((array) $sizes as $name => $size) { echo '<option value="' . esc_attr($name) . '" ' . selected($name, $this->_instance['image_size'], FALSE) . '>' . esc_html($name) . ' (' . absint($size['width']) . 'x' . absint($size['height']) . ')</option>'; } ?> </select> </p> <p> <label for="<?php echo esc_attr($this->_widget_object->get_field_id('image_alignment')); ?> "><?php _e('Image Alignment', 'genesis-author-pro'); ?> :</label> <select id="<?php echo esc_attr($this->_widget_object->get_field_id('image_alignment')); ?> " name="<?php echo esc_attr($this->_widget_object->get_field_name('image_alignment')); ?> "> <option value="alignnone">- <?php _e('None', 'genesis-author-pro'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $this->_instance['image_alignment']); ?> ><?php _e('Left', 'genesis-author-pro'); ?> </option> <option value="alignright" <?php selected('alignright', $this->_instance['image_alignment']); ?> ><?php _e('Right', 'genesis-author-pro'); ?> </option> <option value="aligncenter" <?php selected('aligncenter', $this->_instance['image_alignment']); ?> ><?php _e('Center', 'genesis-author-pro'); ?> </option> </select> </p> <p> <input id="<?php echo $this->_widget_object->get_field_id('show_featured_text'); ?> " type="checkbox" name="<?php echo esc_attr($this->_widget_object->get_field_name('show_featured_text')); ?> " value="1"<?php checked($this->_instance['show_featured_text']); ?> /> <label for="<?php echo esc_attr($this->_widget_object->get_field_id('show_featured_text')); ?> "><?php _e('Show Featured Text With Image', 'genesis'); ?> </label> </p> <?php }
function form($instance) { $instance = wp_parse_args((array) $instance, array('title' => '', 'page_id' => '', 'show_image' => 0, 'image_alignment' => '', 'image_size' => '', 'show_title' => 0, 'show_byline' => 0, 'show_content' => 0, 'content_limit' => '', 'more_text' => __('[Read More...]', 'genesis'))); ?> <p><label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " style="width:95%;" /></p> <p><label for="<?php echo $this->get_field_id('page_id'); ?> "><?php _e('Page', 'genesis'); ?> :</label> <?php wp_dropdown_pages(array('name' => $this->get_field_name('page_id'), 'selected' => $instance['page_id'])); ?> </p> <hr class="div" /> <p><input id="<?php echo $this->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked(1, $instance['show_image']); ?> /> <label for="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Featured Image', 'genesis'); ?> </label></p> <p><label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis'); ?> :</label> <?php $sizes = genesis_get_additional_image_sizes(); ?> <select id="<?php echo $this->get_field_id('image_size'); ?> " name="<?php echo $this->get_field_name('image_size'); ?> "> <option style="padding-right:10px;" value="thumbnail">thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <?php foreach ((array) $sizes as $name => $size) { echo '<option style="padding-right: 10px;" value="' . $name . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . $name . ' (' . $size['width'] . 'x' . $size['height'] . ')</option>'; } ?> </select></p> <p><label for="<?php echo $this->get_field_id('image_alignment'); ?> "><?php _e('Image Alignment', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('image_alignment'); ?> "> <option style="padding-right:10px;" value="">- <?php _e('None', 'genesis'); ?> -</option> <option style="padding-right:10px;" value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option style="padding-right:10px;" value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> </select></p> <hr class="div" /> <p><input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked(1, $instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Page Title', 'genesis'); ?> </label></p> <p><input id="<?php echo $this->get_field_id('show_byline'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_byline'); ?> " value="1" <?php checked(1, $instance['show_byline']); ?> /> <label for="<?php echo $this->get_field_id('show_byline'); ?> "><?php _e('Show Page Byline', 'genesis'); ?> </label></p> <p><input id="<?php echo $this->get_field_id('show_content'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_content'); ?> " value="1" <?php checked(1, $instance['show_content']); ?> /> <label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Show Page Content', 'genesis'); ?> </label></p> <p><label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Content Character Limit', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('content_limit'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr($instance['content_limit']); ?> " size="3" /></p> <p><label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /></p> <?php }
/** * Get image size options. * * @return array Array of image size options. */ public static function get_image_size_options() { $sizes = genesis_get_additional_image_sizes(); $image_size_opt['thumbnail'] = 'thumbnail (' . get_option('thumbnail_size_w') . 'x' . get_option('thumbnail_size_h') . ')'; foreach ((array) $sizes as $name => $size) { $image_size_opt[$name] = esc_html($name) . ' (' . $size['width'] . 'x' . $size['height'] . ')'; } return $image_size_opt; }
function genesis_theme_settings_posts_box() { ?> <p><?php _e("Select one of the following:", 'genesis'); ?> <select name="<?php echo GENESIS_SETTINGS_FIELD; ?> [content_archive]"> <option style="padding-right:10px;" value="full" <?php selected('full', genesis_get_option('content_archive')); ?> ><?php _e("Display full posts", 'genesis'); ?> </option> <option style="padding-right:10px;" value="excerpts" <?php selected('excerpts', genesis_get_option('content_archive')); ?> ><?php _e("Display post excerpts", 'genesis'); ?> </option> </select></p> <p><input type="checkbox" name="<?php echo GENESIS_SETTINGS_FIELD; ?> [thumbnail]" id="<?php echo GENESIS_SETTINGS_FIELD; ?> [thumbnail]" value="1" <?php checked(1, genesis_get_option('thumbnail')); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?> [thumbnail]"><?php _e("Include the post image with excerpts?", 'genesis'); ?> </label> </p> <p><?php _e("Image Size", 'genesis'); ?> : <?php $sizes = genesis_get_additional_image_sizes(); ?> <select name="<?php echo GENESIS_SETTINGS_FIELD; ?> [image_size]"> <option style="padding-right:10px;" value="thumbnail">thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <?php foreach ((array) $sizes as $name => $size) { echo '<option style="padding-right: 10px;" value="' . $name . '" ' . selected($name, genesis_get_option('image_size'), FALSE) . '>' . $name . ' (' . $size['width'] . 'x' . $size['height'] . ')</option>'; } ?> </select></p> <p><?php _e("Select Post Navigation Technique:", 'genesis'); ?> <select name="<?php echo GENESIS_SETTINGS_FIELD; ?> [posts_nav]"> <option style="padding-right:10px;" value="older-newer" <?php selected('older-newer', genesis_get_option('posts_nav')); ?> ><?php _e("Older / Newer", 'genesis'); ?> </option> <option style="padding-right:10px;" value="prev-next" <?php selected('prev-next', genesis_get_option('posts_nav')); ?> ><?php _e("Previous / Next", 'genesis'); ?> </option> <option style="padding-right:10px;" value="numeric" <?php selected('numeric', genesis_get_option('posts_nav')); ?> ><?php _e("Numeric", 'genesis'); ?> </option> </select></p> <p><span class="description"><strong><?php _e("Note: ", 'genesis'); ?> </strong><?php _e("The post content option will affect any blog listings page, including archive, author, blog, category, search and tag pages.", 'genesis'); ?> </span></p> <?php }
/** * Echo the settings update form. * * @since 0.2.0 * * @param array $instance Current settings */ function form($instance) { //settings_fields('awp_community_featured_widget'); //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> "/> </p> <p> <label for="<?php echo $this->get_field_id('posts_num'); ?> "><?php _e('Number of Posts to Show', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_num'); ?> " name="<?php echo $this->get_field_name('posts_num'); ?> " value="<?php echo esc_attr($instance['posts_num']); ?> " size="2" /> </p> <p> <label for="<?php echo $this->get_field_id('posts_offset'); ?> "><?php _e('Number of Posts to Offset', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_offset'); ?> " name="<?php echo $this->get_field_name('posts_offset'); ?> " value="<?php echo esc_attr($instance['posts_offset']); ?> " size="2" /> </p> <p> <label for="<?php echo $this->get_field_id('orderby'); ?> "><?php _e('Order By', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('orderby'); ?> " name="<?php echo $this->get_field_name('orderby'); ?> "> <option value="date" <?php selected('date', $instance['orderby']); ?> ><?php _e('Date', 'genesis'); ?> </option> <option value="title" <?php selected('title', $instance['orderby']); ?> ><?php _e('Title', 'genesis'); ?> </option> <option value="parent" <?php selected('parent', $instance['orderby']); ?> ><?php _e('Parent', 'genesis'); ?> </option> <option value="menu_order" <?php selected('menu_order', $instance['orderby']); ?> ><?php _e('Menu Order', 'genesis'); ?> </option> <option value="ID" <?php selected('ID', $instance['orderby']); ?> ><?php _e('ID', 'genesis'); ?> </option> <option value="comment_count" <?php selected('comment_count', $instance['orderby']); ?> ><?php _e('Comment Count', 'genesis'); ?> </option> <option value="rand" <?php selected('rand', $instance['orderby']); ?> ><?php _e('Random', 'genesis'); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('order'); ?> "><?php _e('Sort Order', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('order'); ?> " name="<?php echo $this->get_field_name('order'); ?> "> <option value="DESC" <?php selected('DESC', $instance['order']); ?> ><?php _e('Descending (3, 2, 1)', 'genesis'); ?> </option> <option value="ASC" <?php selected('ASC', $instance['order']); ?> ><?php _e('Ascending (1, 2, 3)', 'genesis'); ?> </option> </select> </p> <hr class="div" /> <p> <input id="<?php echo $this->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked($instance['show_image']); ?> /> <label for="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Featured Image', 'genesis'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('image_size'); ?> " class="genesis-image-size-selector" name="<?php echo $this->get_field_name('image_size'); ?> "> <option value="thumbnail">thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <?php $sizes = genesis_get_additional_image_sizes(); foreach ((array) $sizes as $name => $size) { echo '<option value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' ( ' . $size['width'] . 'x' . $size['height'] . ' )</option>'; } ?> </select> </p> <hr class="div" /> <p> <input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked($instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Post Title', 'genesis'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Content Type', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('show_content'); ?> " name="<?php echo $this->get_field_name('show_content'); ?> "> <option value="content" <?php selected('content', $instance['show_content']); ?> ><?php _e('Show Content', 'genesis'); ?> </option> <option value="excerpt" <?php selected('excerpt', $instance['show_content']); ?> ><?php _e('Show Excerpt', 'genesis'); ?> </option> <option value="content-limit" <?php selected('content-limit', $instance['show_content']); ?> ><?php _e('Show Content Limit', 'genesis'); ?> </option> <option value="" <?php selected('', $instance['show_content']); ?> ><?php _e('No Content', 'genesis'); ?> </option> </select> <br /> <label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Limit content to', 'genesis'); ?> <input type="text" id="<?php echo $this->get_field_id('content_limit'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr(intval($instance['content_limit'])); ?> " size="3" /> </label> </p> <?php }
/** * Echo the settings update form on admin widget page. * * @param array $instance Current settings */ function form($instance) { //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); //* Gets widget id prefix, very important for image uploader $id_prefix = $this->get_field_id(''); ?> <!--Widget Title Block--> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis-widget-background'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " class="widefat" /> </p> <hr class="div" /> <!--Featured Page Selection--> <div class="<?php if ($instance['feature_type'] != 'page') { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('wpstudio_widget_background'); ?> " > <p> <label for="<?php echo $this->get_field_id('page_id'); ?> "><?php _e('Select Page', 'genesis-widget-background'); ?> :</label> <?php wp_dropdown_pages(array('name' => $this->get_field_name('page_id'), 'selected' => $instance['page_id'])); ?> </p> </div> <hr class="div" /> <!--Image Type Selection--> <div class="wpstudio-show-image wpstudio-radio"> <label for="<?php echo $this->get_field_id('Select Background:'); ?> "><?php _e('Select Background Image', 'genesis-widget-background'); ?> :</label><br> <label for="<?php echo $this->get_field_id('show_no_image'); ?> "> <input type="radio" id="<?php echo $this->get_field_id('show_no_image'); ?> " name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked(1, $instance['show_image']); ?> /> <span><?php _e('No Image', 'genesis-widget-background'); ?> </span> </label><br /> <label for="<?php echo $this->get_field_id('show_featured_image'); ?> "> <input type="radio" id="<?php echo $this->get_field_id('show_featured_image'); ?> " name="<?php echo $this->get_field_name('show_image'); ?> " <?php if ($instance['feature_type'] != 'page') { echo 'disabled'; } ?> value="2" <?php checked(2, $instance['show_image']); ?> /> <span class="<?php if ($instance['feature_type'] != 'page') { echo 'wpstudio-disabled'; } ?> " id="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Featured Image', 'genesis-widget-background'); ?> </span> </label><br /> <label for="<?php echo $this->get_field_id('show_custom_image'); ?> "> <input type="radio" id="<?php echo $this->get_field_id('show_custom_image'); ?> " name="<?php echo $this->get_field_name('show_image'); ?> " value="3" <?php checked(3, $instance['show_image']); ?> /> <span><?php _e('Show Custom Image', 'genesis-widget-background'); ?> </span> </label> <label for="<?php echo $this->get_field_id('show_background_color'); ?> "> <input type="radio" id="<?php echo $this->get_field_id('show_background_color'); ?> " name="<?php echo $this->get_field_name('show_image'); ?> " value="4" <?php checked(4, $instance['show_image']); ?> /> <span><?php _e('Background Color', 'genesis-widget-background'); ?> </span> </label> </div> <!--Show Featured Image--> <div class="wpstudio-image-size <?php if ($instance['show_image'] != 2) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_image_size'); ?> " > <label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis-widget-background'); ?> :</label> <select id="<?php echo $this->get_field_id('image_size'); ?> " class="genesis-image-size-selector" name="<?php echo $this->get_field_name('image_size'); ?> "> <option value="thumbnail" <?php selected('thumbnail', $instance['image_size']); ?> >Thumbnail (<?php echo absint(get_option('thumbnail_size_w')); ?> ×<?php echo absint(get_option('thumbnail_size_h')); ?> )</option> <option value="medium" <?php selected('medium', $instance['image_size']); ?> >Medium (<?php echo absint(get_option('medium_size_w')); ?> ×<?php echo absint(get_option('medium_size_h')); ?> )</option> <option value="large" <?php selected('large', $instance['image_size']); ?> >Large (<?php echo absint(get_option('large_size_w')); ?> ×<?php echo absint(get_option('large_size_h')); ?> )</option> <option value="full" <?php selected('full', $instance['image_size']); ?> >Full (<?php _e('Original Image Size', 'genesis-widget-background'); ?> )</option> <?php $sizes = genesis_get_additional_image_sizes(); foreach ((array) $sizes as $name => $size) { echo '<option value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' (' . absint($size['width']) . 'x' . absint($size['height']) . ')</option>'; } ?> </select> </div> <!--Show Custom Image--> <div class="<?php if ($instance['show_image'] != 3) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_uploader'); ?> " > <input type="submit" class="button fpa-uploader-button" name="<?php echo $this->get_field_name('uploader_button'); ?> " id="<?php echo $this->get_field_id('uploader_button'); ?> " value="<?php _e('Select an Image', 'genesis-widget-background'); ?> " onclick="fpa_imageUpload.uploader( '<?php echo $this->id; ?> ', '<?php echo $id_prefix; ?> ' ); return false;" /> <div class="wpstudio-image-preview-wrapper"> <div class="wpstudio-image-preview-inner"> <?php if (!empty($instance['custom_image'])) { ?> <img id="<?php echo $this->get_field_id('preview'); ?> " src="<?php echo $instance['custom_image']; ?> " /> <?php } else { ?> <img id="<?php echo $this->get_field_id('preview'); ?> " src="<?php echo plugin_dir_url(__FILE__); ?> ../images/default.jpg" /> <?php } ?> </div> </div> <input type="hidden" id="<?php echo $this->get_field_id('attachment_id'); ?> " name="<?php echo $this->get_field_name('attachment_id'); ?> " value="<?php echo abs($instance['attachment_id']); ?> " /> <input type="hidden" id="<?php echo $this->get_field_id('custom_image'); ?> " name="<?php echo $this->get_field_name('custom_image'); ?> " value="<?php echo $instance['custom_image']; ?> " /> </div> <!--Background Color--> <div class="wpstudio-background_color <?php if ($instance['background_color'] != 4) { echo 'show'; } ?> " id="<?php echo $this->get_field_id('toggle_background_color'); ?> " > <label for="<?php echo $this->get_field_id('background_color'); ?> "><?php _e('Background Color', 'genesis-widget-background'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('background_color'); ?> " name="<?php echo $this->get_field_name('background_color'); ?> " value="<?php echo esc_attr($instance['background_color']); ?> " /> </div> <!--Set Background Fixed--> <div class="wpstudio-background_fixed <?php if ($instance['background_fixed'] != 2) { echo 'show'; } ?> " id="<?php echo $this->get_field_id('toggle_background_fixed'); ?> " > <hr class="div" /> <input class="checkbox" type="checkbox" <?php checked($instance['background_fixed'], 'on'); ?> id="<?php echo $this->get_field_id('background_fixed'); ?> " name="<?php echo $this->get_field_name('background_fixed'); ?> " /> <label for="<?php echo $this->get_field_id('background_fixed'); ?> "><?php _e('Background Fixed', 'genesis-widget-background'); ?> </label> </div> <hr class="div" /> <!--Featured Page Specific Settings - Hide if using Custom Link--> <div class="<?php if ($instance['feature_type'] != 'page') { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('wpstudio_widget_background_settings'); ?> " > <!--Page Title Block--> <p class="wpstudio-toggle-page-settings"> <input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked($instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Page Title', 'genesis-widget-background'); ?> </label> </p> <hr class="div" /> <!--Page Content Block--> <p class="wpstudio-toggle-content-limit"> <input id="<?php echo $this->get_field_id('show_content'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_content'); ?> " value="1" <?php checked($instance['show_content']); ?> /> <label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Show Page Content', 'genesis-widget-background'); ?> </label> </p> <p class="<?php if ($instance['show_content'] != 1) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_content_limit'); ?> "> <label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Content Character Limit', 'genesis-widget-background'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('content_limit'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr($instance['content_limit']); ?> " size="3" /> </p> </div> <hr class="div" /> <!--Read More Button/Text--> <p class="wpstudio-read-more"> <label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text', 'genesis-widget-background'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /> </p> <?php }
/** * Echo the settings update form. * * @since 0.1.8 * * @param array $instance Current settings */ function form($instance) { //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); // Fetch a list of possible post types $args = array('public' => true, '_builtin' => false); $output = 'names'; $operator = 'and'; $post_type_list = get_post_types($args, $output, $operator); // Add posts to that post_type_list $post_type_list['post'] = 'post'; // And a list of available taxonomies for the current post type if ('any' == $instance['post_type']) { $taxonomies = get_taxonomies(); } else { $taxonomies = get_object_taxonomies($instance['post_type']); } // And from there, a list of available terms in that tax $tax_args = array('hide_empty' => 0); $tax_term_list = get_terms($taxonomies, $tax_args); usort($tax_term_list, array($this, 'tax_term_compare')); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis-featured-custom-post-type-widget'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " class="widefat" /> </p> <div class="genesis-widget-column"> <div class="genesis-widget-column-box genesis-widget-column-box-top"> <p> <label for="<?php echo $this->get_field_id('post_type'); ?> "><?php _e('Post Type', 'genesis-featured-custom-post-type-widget'); ?> :</label> <select id="<?php echo $this->get_field_id('post_type'); ?> " name="<?php echo $this->get_field_name('post_type'); ?> " onchange="tax_term_postback('<?php echo $this->get_field_id('tax_term'); ?> ', this.value);" > <?php foreach ($post_type_list as $post_type_item) { echo '<option style="padding-right:10px;" value="' . esc_attr($post_type_item) . '" ' . selected(esc_attr($post_type_item), $instance['post_type'], false) . '>' . esc_attr($post_type_item) . '</option>'; } echo '<option style="padding-right:10px;" value="any" ' . selected('any', $instance['post_type'], false) . '>' . __('any', 'genesis-featured-custom-post-type-widget') . '</option>'; ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('tax_term'); ?> "><?php _e('Category/Term', 'genesis-featured-custom-post-type-widget'); ?> :</label> <select id="<?php echo $this->get_field_id('tax_term'); ?> " name="<?php echo $this->get_field_name('tax_term'); ?> "> <?php foreach ($tax_term_list as $tax_term_item) { $tax_term_desc = $tax_term_item->taxonomy . '/' . $tax_term_item->name; $tax_term_slug = $tax_term_item->taxonomy . '/' . $tax_term_item->slug; echo '<option style="padding-right:10px;" value="' . esc_attr($tax_term_slug) . '" ' . selected(esc_attr($tax_term_slug), $instance['tax_term'], false) . '>' . esc_attr($tax_term_desc) . '</option>'; } echo '<option style="padding-right:10px;" value="any" ' . selected('any', $instance['tax_term'], false) . '>' . __('any', 'genesis-featured-custom-post-type-widget') . '</option>'; ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('posts_num'); ?> "><?php _e('Number of Posts to Show', 'genesis-featured-custom-post-type-widget'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_num'); ?> " name="<?php echo $this->get_field_name('posts_num'); ?> " value="<?php echo esc_attr($instance['posts_num']); ?> " size="2" /> </p> <p> <label for="<?php echo $this->get_field_id('posts_offset'); ?> "><?php _e('Number of Posts to Offset', 'genesis-featured-custom-post-type-widget'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_offset'); ?> " name="<?php echo $this->get_field_name('posts_offset'); ?> " value="<?php echo esc_attr($instance['posts_offset']); ?> " size="2" /> </p> <p> <label for="<?php echo $this->get_field_id('orderby'); ?> "><?php _e('Order By', 'genesis-featured-custom-post-type-widget'); ?> :</label> <select id="<?php echo $this->get_field_id('orderby'); ?> " name="<?php echo $this->get_field_name('orderby'); ?> "> <option value="date" <?php selected('date', $instance['orderby']); ?> ><?php _e('Date', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="title" <?php selected('title', $instance['orderby']); ?> ><?php _e('Title', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="parent" <?php selected('parent', $instance['orderby']); ?> ><?php _e('Parent', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="ID" <?php selected('ID', $instance['orderby']); ?> ><?php _e('ID', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="comment_count" <?php selected('comment_count', $instance['orderby']); ?> ><?php _e('Comment Count', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="rand" <?php selected('rand', $instance['orderby']); ?> ><?php _e('Random', 'genesis-featured-custom-post-type-widget'); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('order'); ?> "><?php _e('Sort Order', 'genesis-featured-custom-post-type-widget'); ?> :</label> <select id="<?php echo $this->get_field_id('order'); ?> " name="<?php echo $this->get_field_name('order'); ?> "> <option value="DESC" <?php selected('DESC', $instance['order']); ?> ><?php _e('Descending (3, 2, 1)', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="ASC" <?php selected('ASC', $instance['order']); ?> ><?php _e('Ascending (1, 2, 3)', 'genesis-featured-custom-post-type-widget'); ?> </option> </select> </p> <p> <input id="<?php echo $this->get_field_id('exclude_displayed'); ?> " type="checkbox" name="<?php echo $this->get_field_name('exclude_displayed'); ?> " value="1" <?php checked($instance['exclude_displayed']); ?> /> <label for="<?php echo $this->get_field_id('exclude_displayed'); ?> "><?php _e('Exclude Previously Displayed Posts?', 'genesis-featured-custom-post-type-widget'); ?> </label> </p> </div> <div class="genesis-widget-column-box"> <p> <input id="<?php echo $this->get_field_id('show_gravatar'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_gravatar'); ?> " value="1" <?php checked($instance['show_gravatar']); ?> /> <label for="<?php echo $this->get_field_id('show_gravatar'); ?> "><?php _e('Show Author Gravatar', 'genesis-featured-custom-post-type-widget'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('gravatar_size'); ?> "><?php _e('Gravatar Size', 'genesis-featured-custom-post-type-widget'); ?> :</label> <select id="<?php echo $this->get_field_id('gravatar_size'); ?> " name="<?php echo $this->get_field_name('gravatar_size'); ?> "> <option value="45" <?php selected(45, $instance['gravatar_size']); ?> ><?php _e('Small (45px)', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="65" <?php selected(65, $instance['gravatar_size']); ?> ><?php _e('Medium (65px)', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="85" <?php selected(85, $instance['gravatar_size']); ?> ><?php _e('Large (85px)', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="125" <?php selected(105, $instance['gravatar_size']); ?> ><?php _e('Extra Large (125px)', 'genesis-featured-custom-post-type-widget'); ?> </option> </select> </p> <p> <label for="<?php echo $this->get_field_id('gravatar_alignment'); ?> "><?php _e('Gravatar Alignment', 'genesis-featured-custom-post-type-widget'); ?> :</label> <select id="<?php echo $this->get_field_id('gravatar_alignment'); ?> " name="<?php echo $this->get_field_name('gravatar_alignment'); ?> "> <option value="alignnone">- <?php _e('None', 'genesis-featured-custom-post-type-widget'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $instance['gravatar_alignment']); ?> ><?php _e('Left', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="alignright" <?php selected('alignright', $instance['gravatar_alignment']); ?> ><?php _e('Right', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="aligncenter" <?php selected('aligncenter', $instance['gravatar_alignment']); ?> ><?php _e('Center', 'genesis-featured-custom-post-type-widget'); ?> </option> </select> </p> </div> <div class="genesis-widget-column-box"> <p> <input id="<?php echo $this->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked($instance['show_image']); ?> /> <label for="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Featured Image', 'genesis-featured-custom-post-type-widget'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis-featured-custom-post-type-widget'); ?> :</label> <select id="<?php echo $this->get_field_id('image_size'); ?> " class="genesis-image-size-selector" name="<?php echo $this->get_field_name('image_size'); ?> "> <option value="thumbnail">thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <?php $sizes = genesis_get_additional_image_sizes(); foreach ((array) $sizes as $name => $size) { echo '<option value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' ( ' . $size['width'] . 'x' . $size['height'] . ' )</option>'; } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('image_alignment'); ?> "><?php _e('Image Alignment', 'genesis-featured-custom-post-type-widget'); ?> :</label> <select id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('image_alignment'); ?> "> <option value="alignnone">- <?php _e('None', 'genesis-featured-custom-post-type-widget'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="aligncenter" <?php selected('aligncenter', $instance['image_alignment']); ?> ><?php _e('Center', 'genesis-featured-custom-post-type-widget'); ?> </option> </select> </p> </div> </div> <div class="genesis-widget-column genesis-widget-column-right"> <div class="genesis-widget-column-box genesis-widget-column-box-top"> <p> <input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked($instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Post Title', 'genesis-featured-custom-post-type-widget'); ?> </label> </p> <p> <input id="<?php echo $this->get_field_id('show_byline'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_byline'); ?> " value="1" <?php checked($instance['show_byline']); ?> /> <label for="<?php echo $this->get_field_id('show_byline'); ?> "><?php _e('Show Post Info', 'genesis-featured-custom-post-type-widget'); ?> </label> <input type="text" id="<?php echo $this->get_field_id('post_info'); ?> " name="<?php echo $this->get_field_name('post_info'); ?> " value="<?php echo esc_attr($instance['post_info']); ?> " class="widefat" /> </p> <p> <label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Content Type', 'genesis-featured-custom-post-type-widget'); ?> :</label> <select id="<?php echo $this->get_field_id('show_content'); ?> " name="<?php echo $this->get_field_name('show_content'); ?> "> <option value="content" <?php selected('content', $instance['show_content']); ?> ><?php _e('Show Content', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="excerpt" <?php selected('excerpt', $instance['show_content']); ?> ><?php _e('Show Excerpt', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="content-limit" <?php selected('content-limit', $instance['show_content']); ?> ><?php _e('Show Content Limit', 'genesis-featured-custom-post-type-widget'); ?> </option> <option value="" <?php selected('', $instance['show_content']); ?> ><?php _e('No Content', 'genesis-featured-custom-post-type-widget'); ?> </option> </select> <br /> <label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Limit content to', 'genesis-featured-custom-post-type-widget'); ?> <input type="text" id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr(intval($instance['content_limit'])); ?> " size="3" /> <?php _e('characters', 'genesis-featured-custom-post-type-widget'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text (if applicable)', 'genesis-featured-custom-post-type-widget'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /> </p> </div> <div class="genesis-widget-column-box"> <p><?php _e('To display an unordered list of more posts from this category, please fill out the information below', 'genesis-featured-custom-post-type-widget'); ?> :</p> <p> <label for="<?php echo $this->get_field_id('extra_title'); ?> "><?php _e('Title', 'genesis-featured-custom-post-type-widget'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('extra_title'); ?> " name="<?php echo $this->get_field_name('extra_title'); ?> " value="<?php echo esc_attr($instance['extra_title']); ?> " class="widefat" /> </p> <p> <label for="<?php echo $this->get_field_id('extra_num'); ?> "><?php _e('Number of Posts to Show', 'genesis-featured-custom-post-type-widget'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('extra_num'); ?> " name="<?php echo $this->get_field_name('extra_num'); ?> " value="<?php echo esc_attr($instance['extra_num']); ?> " size="2" /> </p> </div> <div class="genesis-widget-column-box"> <p> <input id="<?php echo $this->get_field_id('more_from_category'); ?> " type="checkbox" name="<?php echo $this->get_field_name('more_from_category'); ?> " value="1" <?php checked($instance['more_from_category']); ?> /> <label for="<?php echo $this->get_field_id('more_from_category'); ?> "><?php _e('Show Category Archive Link', 'genesis-featured-custom-post-type-widget'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('more_from_category_text'); ?> "><?php _e('Link Text', 'genesis-featured-custom-post-type-widget'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_from_category_text'); ?> " name="<?php echo $this->get_field_name('more_from_category_text'); ?> " value="<?php echo esc_attr($instance['more_from_category_text']); ?> " class="widefat" /> </p> </div> </div> <?php }
/** * Creates Widget Form * * @author Nick Croft * @since 0.1 * @version 0.5 * @param array $instance Values set in widget isntance */ function form($instance) { // ensure value exists $instance = wp_parse_args((array) $instance, array('title' => '', 'post_type' => 'post', 'page_id' => '', 'posts_term' => '', 'exclude_terms' => '', 'exclude_cat' => '', 'include_exclude' => '', 'post_id' => '', 'posts_num' => 1, 'posts_offset' => 0, 'orderby' => '', 'order' => '', 'meta_key' => '', 'show_sticky' => '', 'paged' => '', 'show_paged' => '', 'post_align' => '', 'show_image' => 0, 'link_image' => 1, 'image_position' => 'before-title', 'image_alignment' => '', 'image_size' => '', 'show_gravatar' => 0, 'gravatar_alignment' => '', 'gravatar_size' => '', 'show_title' => 0, 'link_title' => 1, 'title_limit' => '', 'show_byline' => 0, 'post_info' => '[post_date] ' . __('By', 'gfwa') . ' [post_author_posts_link] [post_comments]', 'show_content' => 'excerpt', 'show_archive_line' => 0, 'post_meta' => '[post_categories] [post_tags]', 'content_limit' => '', 'more_text' => __('[Read More...]', 'gfwa'), 'extra_posts' => '', 'extra_num' => '', 'extra_title' => '', 'extra_format' => 'ul', 'more_from_category' => '', 'more_from_category_text' => __('More Posts from this Taxonomy', 'gfwa'), 'archive_link' => '', 'custom_field' => '')); ?> <p><label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " style="width:99%;" /></p> <div style="float: left; width: 250px;"> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px;"> <p><label for="<?php echo $this->get_field_id('post_type'); ?> "><?php _e('Post Type', 'gfwa'); ?> :</label> <select class="widget-control-save" id="<?php echo $this->get_field_id('post_type'); ?> " name="<?php echo $this->get_field_name('post_type'); ?> "> <?php $args = array('public' => true); $output = 'names'; $operator = 'and'; $post_types = get_post_types($args, $output, $operator); $post_types = array_filter($post_types, 'gfwa_exclude_post_types'); foreach ($post_types as $post_type) { ?> <option style="padding-right:10px;" value="<?php echo esc_attr($post_type); ?> " <?php selected(esc_attr($post_type), $instance['post_type']); ?> ><?php echo esc_attr($post_type); ?> </option><?php } ?> </select></p> <p style="<?php gfwa_display_option($instance, 'post_type', 'page', false); ?> "><label for="<?php echo $this->get_field_id('page_id'); ?> "><?php _e('Page', 'genesis'); ?> :</label> <select class="widget-control-save" id="<?php echo $this->get_field_id('page_id'); ?> " name="<?php echo $this->get_field_name('page_id'); ?> "> <option value="" <?php selected('', $instance['page_id']); ?> ><?php echo attribute_escape(__('Select page', 'gfwa')); ?> </option> <?php $pages = get_pages(); foreach ($pages as $page) { ?> <option style="padding-right:10px;" value="<?php echo esc_attr($page->ID); ?> " <?php selected(esc_attr($page->ID), $instance['page_id']); ?> ><?php echo esc_attr($page->post_title); ?> </option><?php } ?> </select> </p> <p style="<?php gfwa_display_option($instance, 'post_type', 'page'); ?> "><label for="<?php echo $this->get_field_id('posts_term'); ?> "><?php _e('Taxonomy and Terms', 'gfwa'); ?> :</label> <select id="<?php echo $this->get_field_id('posts_term'); ?> " name="<?php echo $this->get_field_name('posts_term'); ?> "> <option style="padding-right:10px;" value="" <?php selected('', $instance['posts_term']); ?> ><?php _e('All Taxonomies and Terms', 'gfwa'); ?> </option> <?php $taxonomies = get_taxonomies(array('public' => true), 'objects'); $taxonomies = array_filter($taxonomies, 'gfwa_exclude_taxonomies'); $test = get_taxonomies(array('public' => true), 'objects'); foreach ($taxonomies as $taxonomy) { $query_label = ''; if (!empty($taxonomy->query_var)) { $query_label = $taxonomy->query_var; } else { $query_label = $taxonomy->name; } ?> <optgroup label="<?php echo esc_attr($taxonomy->labels->name); ?> "> <option style="margin-left: 5px; padding-right:10px;" value="<?php echo esc_attr($query_label); ?> " <?php selected(esc_attr($query_label), $instance['posts_term']); ?> ><?php echo $taxonomy->labels->all_items; ?> </option><?php $terms = get_terms($taxonomy->name, 'orderby=name&hide_empty=1'); foreach ($terms as $term) { ?> <option style="margin-left: 8px; padding-right:10px;" value="<?php echo esc_attr($query_label) . ',' . $term->slug; ?> " <?php selected(esc_attr($query_label) . ',' . $term->slug, $instance['posts_term']); ?> ><?php echo '-' . esc_attr($term->name); ?> </option><?php } ?> </optgroup> <?php } ?> </select></p> <p style="<?php gfwa_display_option($instance, 'post_type', 'page'); ?> "><label for="<?php echo $this->get_field_id('exclude_terms'); ?> "><?php printf(__('Exclude Terms by ID %s (comma separated list)', 'gfwa'), '<br />'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('exclude_terms'); ?> " name="<?php echo $this->get_field_name('exclude_terms'); ?> " value="<?php echo esc_attr($instance['exclude_terms']); ?> " style="width:95%;" /></p> <p style="<?php gfwa_display_option($instance, 'page_id', '', false); ?> "><label for="<?php echo $this->get_field_id('include_exclude'); ?> "><?php printf(__('Include or Exclude by %s ID', 'gfwa'), $instance['post_type']); ?> :</label> <select class="widget-control-save" id="<?php echo $this->get_field_id('include_exclude'); ?> " name="<?php echo $this->get_field_name('include_exclude'); ?> "> <option style="padding-right:10px;" value="" <?php selected('', $instance['include_exclude']); ?> ><?php _e('Select', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="include" <?php selected('include', $instance['include_exclude']); ?> ><?php _e('Include', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="exclude" <?php selected('exclude', $instance['include_exclude']); ?> ><?php _e('Exclude', 'gfwa'); ?> </option> </select></p> <p style="<?php gfwa_display_option($instance, 'page_id', '', false); gfwa_display_option($instance, 'include_exclude'); ?> "><label for="<?php echo $this->get_field_id('post_id'); ?> "><?php echo $instance['post_type'] . ' ' . __('ID', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('post_id'); ?> " name="<?php echo $this->get_field_name('post_id'); ?> " value="<?php echo esc_attr($instance['post_id']); ?> " style="width:95%;" /></p> <p style="<?php gfwa_display_option($instance, 'page_id', '', false); ?> "><label for="<?php echo $this->get_field_id('meta_key'); ?> "><?php _e('Meta Key', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('meta_key'); ?> " name="<?php echo $this->get_field_name('meta_key'); ?> " value="<?php echo esc_attr($instance['meta_key']); ?> " style="width:95%;" /></p> <p style="<?php gfwa_display_option($instance, 'page_id', '', false); ?> "><label for="<?php echo $this->get_field_id('posts_num'); ?> "><?php _e('Number of Posts to Show', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_num'); ?> " name="<?php echo $this->get_field_name('posts_num'); ?> " value="<?php echo esc_attr($instance['posts_num']); ?> " size="2" /></p> <p style="<?php gfwa_display_option($instance, 'page_id', '', false); ?> "><label for="<?php echo $this->get_field_id('posts_offset'); ?> "><?php _e('Number of Posts to Offset', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_offset'); ?> " name="<?php echo $this->get_field_name('posts_offset'); ?> " value="<?php echo esc_attr($instance['posts_offset']); ?> " size="2" /></p> <p style="<?php gfwa_display_option($instance, 'page_id', '', false); ?> "><label for="<?php echo $this->get_field_id('orderby'); ?> "><?php _e('Order By', 'gfwa'); ?> :</label> <select id="<?php echo $this->get_field_id('orderby'); ?> " name="<?php echo $this->get_field_name('orderby'); ?> "> <option style="padding-right:10px;" value="date" <?php selected('date', $instance['orderby']); ?> ><?php _e('Date', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="title" <?php selected('title', $instance['orderby']); ?> ><?php _e('Title', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="parent" <?php selected('parent', $instance['orderby']); ?> ><?php _e('Parent', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="ID" <?php selected('ID', $instance['orderby']); ?> ><?php _e('ID', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="comment_count" <?php selected('comment_count', $instance['orderby']); ?> ><?php _e('Comment Count', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="rand" <?php selected('rand', $instance['orderby']); ?> ><?php _e('Random', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="meta_value" <?php selected('meta_value', $instance['orderby']); ?> ><?php _e('Meta Value', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="meta_value_num" <?php selected('meta_value_num', $instance['orderby']); ?> ><?php _e('Numeric Meta Value', 'gfwa'); ?> </option> </select></p> <p style="<?php gfwa_display_option($instance, 'page_id', '', false); ?> "><label for="<?php echo $this->get_field_id('order'); ?> "><?php _e('Sort Order', 'gfwa'); ?> :</label> <select id="<?php echo $this->get_field_id('order'); ?> " name="<?php echo $this->get_field_name('order'); ?> "> <option style="padding-right:10px;" value="DESC" <?php selected('DESC', $instance['order']); ?> ><?php _e('Descending (3, 2, 1)', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="ASC" <?php selected('ASC', $instance['order']); ?> ><?php _e('Ascending (1, 2, 3)', 'gfwa'); ?> </option> </select></p> <p style="<?php gfwa_display_option($instance, 'post_type', 'page'); ?> "><input id="<?php echo $this->get_field_id('paged'); ?> " type="checkbox" name="<?php echo $this->get_field_name('paged'); ?> " value="1" <?php checked(1, $instance['paged']); ?> /> <label for="<?php echo $this->get_field_id('paged'); ?> "><?php _e('Work with Pagination', 'gfwa'); ?> </label></p> <p style="<?php gfwa_display_option($instance, 'post_type', 'page'); ?> "><input id="<?php echo $this->get_field_id('show_paged'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_paged'); ?> " value="1" <?php checked(1, $instance['show_paged']); ?> /> <label for="<?php echo $this->get_field_id('show_paged'); ?> "><?php _e('Show Page Navigation', 'gfwa'); ?> </label></p> </div> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin-top: 10px;"> <p><input class="widget-control-save" id="<?php echo $this->get_field_id('show_gravatar'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_gravatar'); ?> " value="1" <?php checked(1, $instance['show_gravatar']); ?> /> <label for="<?php echo $this->get_field_id('show_gravatar'); ?> "><?php _e('Show Author Gravatar', 'gfwa'); ?> </label></p> <p style="<?php gfwa_display_option($instance, 'show_gravatar'); ?> "><label for="<?php echo $this->get_field_id('gravatar_size'); ?> "><?php _e('Gravatar Size', 'gfwa'); ?> :</label> <select id="<?php echo $this->get_field_id('gravatar_size'); ?> " name="<?php echo $this->get_field_name('gravatar_size'); ?> "> <option style="padding-right:10px;" value="45" <?php selected(45, $instance['gravatar_size']); ?> ><?php _e('Small (45px)', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="65" <?php selected(65, $instance['gravatar_size']); ?> ><?php _e('Medium (65px)', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="85" <?php selected(85, $instance['gravatar_size']); ?> ><?php _e('Large (85px)', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="125" <?php selected(105, $instance['gravatar_size']); ?> ><?php _e('Extra Large (125px)', 'gfwa'); ?> </option> </select></p> <p style="<?php gfwa_display_option($instance, 'show_gravatar'); ?> "><label for="<?php echo $this->get_field_id('gravatar_alignment'); ?> "><?php _e('Gravatar Alignment', 'gfwa'); ?> :</label> <select id="<?php echo $this->get_field_id('gravatar_alignment'); ?> " name="<?php echo $this->get_field_name('gravatar_alignment'); ?> "> <option style="padding-right:10px;" value="">- <?php _e('None', 'gfwa'); ?> -</option> <option style="padding-right:10px;" value="alignleft" <?php selected('alignleft', $instance['gravatar_alignment']); ?> ><?php _e('Left', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="alignright" <?php selected('alignright', $instance['gravatar_alignment']); ?> ><?php _e('Right', 'gfwa'); ?> </option> </select></p> </div> <?php gfwa_form_first_column($instance); ?> </div> <div style="float: left; width: 250px; margin-left: 10px;"> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px;"> <p><input class="widget-control-save" id="<?php echo $this->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked(1, $instance['show_image']); ?> /> <label for="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Featured Image', 'gfwa'); ?> </label></p> <p style="<?php gfwa_display_option($instance, 'show_image'); ?> "><input id="<?php echo $this->get_field_id('link_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('link_image'); ?> " value="1" <?php checked(1, $instance['link_image']); ?> /> <label for="<?php echo $this->get_field_id('link_image'); ?> "><?php _e('Link Image to Post', 'gfwa'); ?> </label></p> <p style="<?php gfwa_display_option($instance, 'show_image'); ?> "><label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'gfwa'); ?> :</label> <?php $sizes = genesis_get_additional_image_sizes(); ?> <select id="<?php echo $this->get_field_id('image_size'); ?> " name="<?php echo $this->get_field_name('image_size'); ?> "> <option style="padding-right:10px;" value="thumbnail">thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <?php foreach ((array) $sizes as $name => $size) { echo '<option style="padding-right: 10px;" value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' (' . $size['width'] . 'x' . $size['height'] . ')</option>'; } ?> </select></p> <p style="<?php gfwa_display_option($instance, 'show_image'); ?> "><label for="<?php echo $this->get_field_id('image_position'); ?> "><?php _e('Image Placement', 'gfwa'); ?> :</label> <select id="<?php echo $this->get_field_id('image_position'); ?> " name="<?php echo $this->get_field_name('image_position'); ?> "> <option style="padding-right:10px;" value="before-title" <?php selected('before-title', $instance['image_position']); ?> ><?php _e('Before Title', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="after-title" <?php selected('after-title', $instance['image_position']); ?> ><?php _e('After Title', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="after-content" <?php selected('after-content', $instance['image_position']); ?> ><?php _e('After Content', 'gfwa'); ?> </option> </select></p> <p style="<?php gfwa_display_option($instance, 'show_image'); ?> "><label for="<?php echo $this->get_field_id('image_alignment'); ?> "><?php _e('Image Alignment', 'gfwa'); ?> :</label> <select id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('image_alignment'); ?> "> <option style="padding-right:10px;" value="">- <?php _e('None', 'gfwa'); ?> -</option> <option style="padding-right:10px;" value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'gfwa'); ?> </option> <option style="padding-right:10px;" value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'gfwa'); ?> </option> </select></p> </div> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin-top: 10px;"> <p><input class="widget-control-save" id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked(1, $instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Post Title', 'gfwa'); ?> </label> <span style="<?php gfwa_display_option($instance, 'show_title'); ?> "> <br /><label for="<?php echo $this->get_field_id('title_limit'); ?> "><?php _e('Limit title to', 'gfwa'); ?> </label> <input type="text" id="<?php echo $this->get_field_id('title_limit'); ?> " name="<?php echo $this->get_field_name('title_limit'); ?> " value="<?php echo esc_attr(intval($instance['title_limit'])); ?> " size="3" /> <?php _e('characters', 'gfwa'); ?> </span></p> <p style="<?php gfwa_display_option($instance, 'show_title'); ?> "><input id="<?php echo $this->get_field_id('link_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('link_title'); ?> " value="1" <?php checked(1, $instance['link_title']); ?> /> <label for="<?php echo $this->get_field_id('link_title'); ?> "><?php _e('Link Title to Post', 'gfwa'); ?> </label></p> <p><input class="widget-control-save" id="<?php echo $this->get_field_id('show_byline'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_byline'); ?> " value="1" <?php checked(1, $instance['show_byline']); ?> /> <label for="<?php echo $this->get_field_id('show_byline'); ?> "><?php _e('Show Post Info', 'gfwa'); ?> </label> <span style="<?php gfwa_display_option($instance, 'show_byline'); ?> "> <br /><input type="text" id="<?php echo $this->get_field_id('post_info'); ?> " name="<?php echo $this->get_field_name('post_info'); ?> " value="<?php echo esc_attr($instance['post_info']); ?> " style="width: 99%;" /> </span> </p> <p><label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Content Type', 'gfwa'); ?> :</label> <select class="widget-control-save" id="<?php echo $this->get_field_id('show_content'); ?> " name="<?php echo $this->get_field_name('show_content'); ?> "> <option value="content" <?php selected('content', $instance['show_content']); ?> ><?php _e('Show Content', 'gfwa'); ?> </option> <option value="excerpt" <?php selected('excerpt', $instance['show_content']); ?> ><?php _e('Show Excerpt', 'gfwa'); ?> </option> <option value="content-limit" <?php selected('content-limit', $instance['show_content']); ?> ><?php _e('Show Content Limit', 'gfwa'); ?> </option> <option value="" <?php selected('', $instance['show_content']); ?> ><?php _e('No Content', 'gfwa'); ?> </option> </select> <span style="<?php gfwa_display_option($instance, 'show_content', 'content-limit', false); ?> "> <br /><label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Limit content to', 'gfwa'); ?> </label> <input type="text" id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr(intval($instance['content_limit'])); ?> " size="3" /> <?php _e('characters', 'gfwa'); ?> </span></p> <p style="<?php gfwa_display_option($instance, 'post_type', 'page'); ?> "><input class="widget-control-save" id="<?php echo $this->get_field_id('show_archive_line'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_archive_line'); ?> " value="1" <?php checked(1, $instance['show_archive_line']); ?> /> <label for="<?php echo $this->get_field_id('show_archive_line'); ?> "><?php _e('Show Post Meta', 'gfwa'); ?> </label> <span style="<?php gfwa_display_option($instance, 'show_archive_line'); ?> "> <br /><input type="text" id="<?php echo $this->get_field_id('post_meta'); ?> " name="<?php echo $this->get_field_name('post_meta'); ?> " value="<?php echo esc_attr($instance['post_meta']); ?> " style="width: 99%;" /> </span> </p> <p><label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text (if applicable)', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /></p> </div> <div style="<?php gfwa_display_option($instance, 'post_type', 'page'); ?> background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin-top: 10px;"> <p><input class="widget-control-save" id="<?php echo $this->get_field_id('extra_posts'); ?> " type="checkbox" name="<?php echo $this->get_field_name('extra_posts'); ?> " value="1" <?php checked(1, $instance['extra_posts']); ?> /> <label for="<?php echo $this->get_field_id('extra_posts'); ?> "><?php _e('Display List of Additional Posts', 'gfwa'); ?> </label></p> <p style="<?php gfwa_display_option($instance, 'extra_posts'); ?> "><label for="<?php echo $this->get_field_id('extra_title'); ?> "><?php _e('Title', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('extra_title'); ?> " name="<?php echo $this->get_field_name('extra_title'); ?> " value="<?php echo esc_attr($instance['extra_title']); ?> " style="width:95%;" /></p> <p style="<?php gfwa_display_option($instance, 'extra_posts'); ?> "><label for="<?php echo $this->get_field_id('extra_num'); ?> "><?php _e('Number of Posts to Show', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('extra_num'); ?> " name="<?php echo $this->get_field_name('extra_num'); ?> " value="<?php echo esc_attr($instance['extra_num']); ?> " size="2" /></p> <p style="<?php gfwa_display_option($instance, 'extra_posts'); ?> "><label for="<?php echo $this->get_field_id('extra_format'); ?> "><?php _e('Extra Post Format', 'gfwa'); ?> :</label> <select class="widget-control-save" id="<?php echo $this->get_field_id('extra_format'); ?> " name="<?php echo $this->get_field_name('extra_format'); ?> "> <option value="ul" <?php selected('ul', $instance['extra_format']); ?> ><?php _e('Unordered List', 'gfwa'); ?> </option> <option value="ol" <?php selected('ol', $instance['extra_format']); ?> ><?php _e('Ordered List', 'gfwa'); ?> </option> <option value="drop_down" <?php selected('drop_down', $instance['extra_format']); ?> ><?php _e('Drop Down', 'gfwa'); ?> </option> </select> </p> </div> <div style="<?php gfwa_display_option($instance, 'post_type', 'page'); ?> background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin: 10px 0;"> <p><input class="widget-control-save" id="<?php echo $this->get_field_id('more_from_category'); ?> " type="checkbox" name="<?php echo $this->get_field_name('more_from_category'); ?> " value="1" <?php checked(1, $instance['more_from_category']); ?> /> <label for="<?php echo $this->get_field_id('more_from_category'); ?> "><?php _e('Show Category Archive Link', 'gfwa'); ?> </label></p> <p style="<?php gfwa_display_option($instance, 'more_from_category'); ?> "><label for="<?php echo $this->get_field_id('more_from_category_text'); ?> "><?php _e('Link Text', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_from_category_text'); ?> " name="<?php echo $this->get_field_name('more_from_category_text'); ?> " value="<?php echo esc_attr($instance['more_from_category_text']); ?> " style="width:95%;" /></p> <p style="<?php gfwa_display_option($instance, 'more_from_category'); ?> "><label for="<?php echo $this->get_field_id('archive_link'); ?> "><?php _e('Optional Archive Link', 'gfwa'); ?> <abbr title="<?php _e('Fill in this value with a URL if you wish to display an archive link when showing all terms or to override the normal archive link to another URL', 'gfwa'); ?> ">*</abbr>:</label> <input type="text" id="<?php echo $this->get_field_id('archive_link'); ?> " name="<?php echo $this->get_field_name('archive_link'); ?> " value="<?php echo esc_attr($instance['archive_link']); ?> " style="width:95%;" /></p> </div> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin: 10px 0;"> <p>Fill in this field if you need to test against an $instance value not included in the form</p> <p><label for="<?php echo $this->get_field_id('custom_field'); ?> "><?php _e('Instance Identification Field', 'gfwa'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('custom_field'); ?> " name="<?php echo $this->get_field_name('custom_field'); ?> " value="<?php echo esc_attr($instance['custom_field']); ?> " style="width:95%;" /></p> </div> <?php gfwa_form_second_column($instance); ?> </div> <?php }
/** * Echo the settings update form on admin widget page. * * @param array $instance Current settings */ function form($instance) { //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); //* Gets widget id prefix, very important for image uploader $id_prefix = $this->get_field_id(''); ?> <!--Widget Title Block--> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis-featured-page-advanced'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " class="widefat" /> </p> <p> <input id="<?php echo $this->get_field_id('enable_title_link'); ?> " type="checkbox" name="<?php echo $this->get_field_name('enable_title_link'); ?> " value="1" <?php checked($instance['enable_title_link']); ?> /> <label for="<?php echo $this->get_field_id('enable_title_link'); ?> "><?php _e('Enable Title Link', 'genesis-featured-page-advanced'); ?> </label> </p> <p> <input id="<?php echo $this->get_field_id('widget_title_below'); ?> " type="checkbox" name="<?php echo $this->get_field_name('widget_title_below'); ?> " value="1" <?php checked($instance['widget_title_below']); ?> /> <label for="<?php echo $this->get_field_id('widget_title_below'); ?> "><?php _e('Position Title Below Image ', 'genesis-featured-page-advanced'); ?> <em><?php _e('(Defaults to Above)', 'genesis-featured-page-advanced'); ?> </em></label> </p> <hr class="div" /> <!--Featured Page Selection--> <div class="fpa-feature-type fpa-radio"> <label for="<?php echo $this->get_field_id('feature_page'); ?> "> <input type="radio" id="<?php echo $this->get_field_id('feature_page'); ?> " name="<?php echo $this->get_field_name('feature_type'); ?> " value="page" <?php checked('page', $instance['feature_type']); ?> /> <span><?php _e('Feature a Page', 'genesis-featured-page-advanced'); ?> </span> </label><br /> <label for="<?php echo $this->get_field_id('feature_custom'); ?> "> <input type="radio" id="<?php echo $this->get_field_id('feature_custom'); ?> " name="<?php echo $this->get_field_name('feature_type'); ?> " value="custom" <?php checked('custom', $instance['feature_type']); ?> /> <span><?php _e('Feature a Custom Link', 'genesis-featured-page-advanced'); ?> </span> </label><br /> </div> <div class="<?php if ($instance['feature_type'] != 'page') { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('feature_type_page'); ?> " > <p> <label for="<?php echo $this->get_field_id('page_id'); ?> "><?php _e('Select Page', 'genesis-featured-page-advanced'); ?> :</label> <?php wp_dropdown_pages(array('name' => $this->get_field_name('page_id'), 'selected' => $instance['page_id'])); ?> </p> </div> <div class="<?php if ($instance['feature_type'] != 'custom') { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('feature_type_custom'); ?> " > <p> <label for="<?php echo $this->get_field_id('custom_link'); ?> "><?php _e('Custom Link', 'genesis-featured-page-advanced'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('custom_link'); ?> " name="<?php echo $this->get_field_name('custom_link'); ?> " value="<?php echo esc_attr($instance['custom_link']); ?> " class="widefat" /> </p> <p> <em><?php _e('This will direct all widget links (title, image, more text) to the custom link. Include the full path, i.e. ', 'genesis-featured-page-advanced'); ?> <code>http://</code></em> </p> </div> <hr class="div" /> <!--Image Type Selection--> <div class="fpa-show-image fpa-radio"> <label for="<?php echo $this->get_field_id('show_no_image'); ?> "> <input type="radio" id="<?php echo $this->get_field_id('show_no_image'); ?> " name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked(1, $instance['show_image']); ?> /> <span><?php _e('No Image', 'genesis-featured-page-advanced'); ?> </span> </label><br /> <label for="<?php echo $this->get_field_id('show_featured_image'); ?> "> <input type="radio" id="<?php echo $this->get_field_id('show_featured_image'); ?> " name="<?php echo $this->get_field_name('show_image'); ?> " <?php if ($instance['feature_type'] != 'page') { echo 'disabled'; } ?> value="2" <?php checked(2, $instance['show_image']); ?> /> <span class="<?php if ($instance['feature_type'] != 'page') { echo 'fpa-disabled'; } ?> " id="<?php echo $this->get_field_id('featured_image_color'); ?> "><?php _e('Show Featured Image', 'genesis-featured-page-advanced'); ?> </span> </label><br /> <label for="<?php echo $this->get_field_id('show_custom_image'); ?> "> <input type="radio" id="<?php echo $this->get_field_id('show_custom_image'); ?> " name="<?php echo $this->get_field_name('show_image'); ?> " value="3" <?php checked(3, $instance['show_image']); ?> /> <span><?php _e('Show Custom Image', 'genesis-featured-page-advanced'); ?> </span> </label> </div> <!--Show Featured Image--> <div class="fpa-image-size <?php if ($instance['show_image'] != 2) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_image_size'); ?> " > <label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis-featured-page-advanced'); ?> :</label> <select id="<?php echo $this->get_field_id('image_size'); ?> " class="genesis-image-size-selector" name="<?php echo $this->get_field_name('image_size'); ?> "> <option value="thumbnail" <?php selected('thumbnail', $instance['image_size']); ?> >Thumbnail (<?php echo absint(get_option('thumbnail_size_w')); ?> ×<?php echo absint(get_option('thumbnail_size_h')); ?> )</option> <option value="medium" <?php selected('medium', $instance['image_size']); ?> >Medium (<?php echo absint(get_option('medium_size_w')); ?> ×<?php echo absint(get_option('medium_size_h')); ?> )</option> <option value="large" <?php selected('large', $instance['image_size']); ?> >Large (<?php echo absint(get_option('large_size_w')); ?> ×<?php echo absint(get_option('large_size_h')); ?> )</option> <option value="full" <?php selected('full', $instance['image_size']); ?> >Full (<?php _e('Original Image Size', 'genesis-featured-page-advanced'); ?> )</option> <?php $sizes = genesis_get_additional_image_sizes(); foreach ((array) $sizes as $name => $size) { echo '<option value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' (' . absint($size['width']) . 'x' . absint($size['height']) . ')</option>'; } ?> </select> </div> <!--Show Custom Image--> <div class="<?php if ($instance['show_image'] != 3) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_uploader'); ?> " > <input type="submit" class="button fpa-uploader-button" name="<?php echo $this->get_field_name('uploader_button'); ?> " id="<?php echo $this->get_field_id('uploader_button'); ?> " value="<?php _e('Select an Image', 'genesis'); ?> " onclick="fpa_imageUpload.uploader( '<?php echo $this->id; ?> ', '<?php echo $id_prefix; ?> ' ); return false;" /> <div class="fpa-image-preview-wrapper"> <div class="fpa-image-preview-inner"> <?php if (!empty($instance['custom_image'])) { ?> <img id="<?php echo $this->get_field_id('preview'); ?> " src="<?php echo $instance['custom_image']; ?> " /> <?php } else { ?> <img id="<?php echo $this->get_field_id('preview'); ?> " src="<?php echo plugin_dir_url(__FILE__); ?> ../images/default.jpg" /> <?php } ?> </div> </div> <input type="hidden" id="<?php echo $this->get_field_id('attachment_id'); ?> " name="<?php echo $this->get_field_name('attachment_id'); ?> " value="<?php echo abs($instance['attachment_id']); ?> " /> <input type="hidden" id="<?php echo $this->get_field_id('custom_image'); ?> " name="<?php echo $this->get_field_name('custom_image'); ?> " value="<?php echo $instance['custom_image']; ?> " /> </div> <!--Image Alignment--> <p class="<?php if ($instance['show_image'] == 1) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_image_alignment'); ?> " > <label for="<?php echo $this->get_field_id('image_alignment'); ?> "><?php _e('Image Alignment', 'genesis-featured-page-advanced'); ?> :</label> <select id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('image_alignment'); ?> "> <option value="alignnone">- <?php _e('None', 'genesis-featured-page-advanced'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'genesis-featured-page-advanced'); ?> </option> <option value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'genesis-featured-page-advanced'); ?> </option> </select> </p> <p class="<?php if ($instance['show_image'] == 1) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_image_link'); ?> "> <input id="<?php echo $this->get_field_id('enable_image_link'); ?> " type="checkbox" name="<?php echo $this->get_field_name('enable_image_link'); ?> " value="1" <?php checked(1, $instance['enable_image_link']); ?> /> <label for="<?php echo $this->get_field_id('enable_image_link'); ?> "><?php _e('Enable Image Link', 'genesis-featured-page-advanced'); ?> </label> </p> <hr class="div" /> <!--Featured Page Specific Settings - Hide if using Custom Link--> <div class="<?php if ($instance['feature_type'] != 'page') { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('feature_type_page_settings'); ?> " > <!--Page Title Block--> <p class="fpa-toggle-page-settings"> <input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked($instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Page Title', 'genesis-featured-page-advanced'); ?> </label> </p> <div class="<?php if ($instance['show_title'] != 1) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_page_settings'); ?> "> <p> <input id="<?php echo $this->get_field_id('enable_page_title_link'); ?> " type="checkbox" name="<?php echo $this->get_field_name('enable_page_title_link'); ?> " value="1" <?php checked(1, $instance['enable_page_title_link']); ?> /> <label for="<?php echo $this->get_field_id('enable_page_title_link'); ?> "><?php _e('Enable Page Title Link', 'genesis-featured-page-advanced'); ?> </label> </p> <p> <input id="<?php echo $this->get_field_id('page_title_above'); ?> " type="checkbox" name="<?php echo $this->get_field_name('page_title_above'); ?> " value="1" <?php checked($instance['page_title_above']); ?> /> <label for="<?php echo $this->get_field_id('page_title_above'); ?> "><?php _e('Position Page Title Above Image ', 'genesis-featured-page-advanced'); ?> <em><?php _e('(Defaults to Below)', 'genesis-featured-page-advanced'); ?> </em></label> </p> </div> <hr class="div" /> <!--Page Content Block--> <p class="fpa-toggle-content-limit"> <input id="<?php echo $this->get_field_id('show_content'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_content'); ?> " value="1" <?php checked($instance['show_content']); ?> /> <label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Show Page Content', 'genesis-featured-page-advanced'); ?> </label> </p> <p class="<?php if ($instance['show_content'] != 1) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_content_limit'); ?> "> <label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Content Character Limit', 'genesis-featured-page-advanced'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('content_limit'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr($instance['content_limit']); ?> " size="3" /> </p> <!--Enable Page Excerpt--> <p> <input id="<?php echo $this->get_field_id('show_excerpt'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_excerpt'); ?> " value="1" <?php checked($instance['show_excerpt']); ?> /> <label for="<?php echo $this->get_field_id('show_excerpt'); ?> "><?php _e('Show Page Excerpt', 'genesis-featured-page-advanced'); ?> </label> </p> </div> <!--Custom Content Block--> <p class="fpa-toggle-custom-content"> <input id="<?php echo $this->get_field_id('show_custom_content'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_custom_content'); ?> " value="1" <?php checked($instance['show_custom_content']); ?> /> <label for="<?php echo $this->get_field_id('show_custom_content'); ?> "><?php _e('Show Custom Content', 'genesis-featured-page-advanced'); ?> </label> </p> <p class="<?php if ($instance['show_custom_content'] != 1) { echo 'hidden'; } ?> " id="<?php echo $this->get_field_id('toggle_custom_content'); ?> "> <label for="<?php echo $this->get_field_id('custom_content'); ?> "><?php _e('Custom Content', 'genesis-featured-page-advanced'); ?> :</label><br /> <textarea rows="4" id="<?php echo $this->get_field_id('custom_content'); ?> " name="<?php echo $this->get_field_name('custom_content'); ?> " class="widefat" style="max-width: 100%" ><?php echo esc_html($instance['custom_content']); ?> </textarea> </p> <hr class="div" /> <!--Read More Button/Text--> <p class="fpa-read-more"> <label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text', 'genesis-featured-page-advanced'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /> </p> <?php }
/** * Echo the settings update form. * * @since 0.1.8 * * @param array $instance Current settings */ function form($instance) { $text = esc_textarea($instance['custom_text']); //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " class="widefat" /> </p> <p> <label for="<?php echo $this->get_field_id('page_id'); ?> "><?php _e('Page', 'genesis'); ?> :</label> <?php wp_dropdown_pages(array('name' => $this->get_field_name('page_id'), 'selected' => $instance['page_id'])); ?> </p> <hr class="div" /> <p> <input id="<?php echo $this->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_image'); ?> " value="1"<?php checked($instance['show_image']); ?> /> <label for="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Featured Image', 'genesis'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('image_size'); ?> " class="genesis-image-size-selector" name="<?php echo $this->get_field_name('image_size'); ?> "> <option value="thumbnail">thumbnail (<?php echo absint(get_option('thumbnail_size_w')); ?> x<?php echo absint(get_option('thumbnail_size_h')); ?> )</option> <?php $sizes = genesis_get_additional_image_sizes(); foreach ((array) $sizes as $name => $size) { echo '<option value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' (' . absint($size['width']) . 'x' . absint($size['height']) . ')</option>'; } ?> </select> </p> <p> <label for="<?php echo $this->get_field_id('image_alignment'); ?> "><?php _e('Image Alignment', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('image_alignment'); ?> "> <option value="alignnone">- <?php _e('None', 'genesis'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> </select> </p> <hr class="div" /> <p> <input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1"<?php checked($instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Page Title', 'genesis'); ?> </label> </p> <p> <input id="<?php echo $this->get_field_id('show_content'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_content'); ?> " value="1"<?php checked($instance['show_content']); ?> /> <label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Show Page Content', 'genesis'); ?> </label> </p> <p> <label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Content Character Limit', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('content_limit'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr($instance['content_limit']); ?> " size="3" /> </p> <p><label for="<?php echo $this->get_field_id('custom_text'); ?> "><?php _e('Custom Text:'); ?> </label><textarea class="widefat" rows="16" cols="20" id="<?php echo $this->get_field_id('custom_text'); ?> " name="<?php echo $this->get_field_name('custom_text'); ?> "><?php echo $text; ?> </textarea></p> <p><input id="<?php echo $this->get_field_id('filter'); ?> " name="<?php echo $this->get_field_name('filter'); ?> " type="checkbox" <?php checked(isset($instance['filter']) ? $instance['filter'] : 0); ?> /> <label for="<?php echo $this->get_field_id('filter'); ?> "><?php _e('Automatically add paragraphs'); ?> </label></p> <p> <label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /> </p> <?php }
function form($instance) { // ensure value exists $instance = wp_parse_args((array) $instance, array('title' => '', 'posts_cat' => '', 'posts_num' => 0, 'posts_offset' => 0, 'orderby' => '', 'order' => '', 'show_image' => 0, 'image_alignment' => '', 'image_size' => '', 'show_gravatar' => 0, 'gravatar_alignment' => '', 'gravatar_size' => '', 'show_title' => 0, 'show_byline' => 0, 'post_info' => '[post_date] ' . __('By', 'genesis') . ' [post_author_posts_link] [post_comments]', 'show_content' => 'excerpt', 'content_limit' => '', 'more_text' => __('[Read More...]', 'genesis'), 'extra_num' => '', 'extra_title' => '', 'more_from_category' => '', 'more_from_category_text' => __('More Posts from this Category', 'genesis'))); ?> <p><label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo $this->get_field_name('title'); ?> " value="<?php echo esc_attr($instance['title']); ?> " style="width:99%;" /></p> <div style="float: left; width: 250px;"> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px;"> <p><label for="<?php echo $this->get_field_id('posts_cat'); ?> "><?php _e('Category', 'genesis'); ?> :</label> <?php wp_dropdown_categories(array('name' => $this->get_field_name('posts_cat'), 'selected' => $instance['posts_cat'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __("All Categories", 'genesis'), 'hide_empty' => '0')); ?> </p> <p><label for="<?php echo $this->get_field_id('posts_num'); ?> "><?php _e('Number of Posts to Show', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_num'); ?> " name="<?php echo $this->get_field_name('posts_num'); ?> " value="<?php echo esc_attr($instance['posts_num']); ?> " size="2" /></p> <p><label for="<?php echo $this->get_field_id('posts_offset'); ?> "><?php _e('Number of Posts to Offset', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('posts_offset'); ?> " name="<?php echo $this->get_field_name('posts_offset'); ?> " value="<?php echo esc_attr($instance['posts_offset']); ?> " size="2" /></p> <p><label for="<?php echo $this->get_field_id('orderby'); ?> "><?php _e('Order By', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('orderby'); ?> " name="<?php echo $this->get_field_name('orderby'); ?> "> <option style="padding-right:10px;" value="date" <?php selected('date', $instance['orderby']); ?> ><?php _e('Date', 'genesis'); ?> </option> <option style="padding-right:10px;" value="title" <?php selected('title', $instance['orderby']); ?> ><?php _e('Title', 'genesis'); ?> </option> <option style="padding-right:10px;" value="parent" <?php selected('parent', $instance['orderby']); ?> ><?php _e('Parent', 'genesis'); ?> </option> <option style="padding-right:10px;" value="ID" <?php selected('ID', $instance['orderby']); ?> ><?php _e('ID', 'genesis'); ?> </option> <option style="padding-right:10px;" value="comment_count" <?php selected('comment_count', $instance['orderby']); ?> ><?php _e('Comment Count', 'genesis'); ?> </option> <option style="padding-right:10px;" value="rand" <?php selected('rand', $instance['orderby']); ?> ><?php _e('Random', 'genesis'); ?> </option> </select></p> <p><label for="<?php echo $this->get_field_id('order'); ?> "><?php _e('Sort Order', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('order'); ?> " name="<?php echo $this->get_field_name('order'); ?> "> <option style="padding-right:10px;" value="DESC" <?php selected('DESC', $instance['order']); ?> ><?php _e('Descending (3, 2, 1)', 'genesis'); ?> </option> <option style="padding-right:10px;" value="ASC" <?php selected('ASC', $instance['order']); ?> ><?php _e('Ascending (1, 2, 3)', 'genesis'); ?> </option> </select></p> </div> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin-top: 10px;"> <p><input id="<?php echo $this->get_field_id('show_gravatar'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_gravatar'); ?> " value="1" <?php checked(1, $instance['show_gravatar']); ?> /> <label for="<?php echo $this->get_field_id('show_gravatar'); ?> "><?php _e('Show Author Gravatar', 'genesis'); ?> </label></p> <p><label for="<?php echo $this->get_field_id('gravatar_size'); ?> "><?php _e('Gravatar Size', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('gravatar_size'); ?> " name="<?php echo $this->get_field_name('gravatar_size'); ?> "> <option style="padding-right:10px;" value="45" <?php selected(45, $instance['gravatar_size']); ?> ><?php _e('Small (45px)', 'genesis'); ?> </option> <option style="padding-right:10px;" value="65" <?php selected(65, $instance['gravatar_size']); ?> ><?php _e('Medium (65px)', 'genesis'); ?> </option> <option style="padding-right:10px;" value="85" <?php selected(85, $instance['gravatar_size']); ?> ><?php _e('Large (85px)', 'genesis'); ?> </option> <option style="padding-right:10px;" value="125" <?php selected(105, $instance['gravatar_size']); ?> ><?php _e('Extra Large (125px)', 'genesis'); ?> </option> </select></p> <p><label for="<?php echo $this->get_field_id('gravatar_alignment'); ?> "><?php _e('Gravatar Alignment', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('gravatar_alignment'); ?> " name="<?php echo $this->get_field_name('gravatar_alignment'); ?> "> <option style="padding-right:10px;" value="">- <?php _e('None', 'genesis'); ?> -</option> <option style="padding-right:10px;" value="alignleft" <?php selected('alignleft', $instance['gravatar_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option style="padding-right:10px;" value="alignright" <?php selected('alignright', $instance['gravatar_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> </select></p> </div> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin-top: 10px;"> <p><input id="<?php echo $this->get_field_id('show_image'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_image'); ?> " value="1" <?php checked(1, $instance['show_image']); ?> /> <label for="<?php echo $this->get_field_id('show_image'); ?> "><?php _e('Show Featured Image', 'genesis'); ?> </label></p> <p><label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis'); ?> :</label> <?php $sizes = genesis_get_additional_image_sizes(); ?> <select id="<?php echo $this->get_field_id('image_size'); ?> " name="<?php echo $this->get_field_name('image_size'); ?> "> <option style="padding-right:10px;" value="thumbnail">thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <?php foreach ((array) $sizes as $name => $size) { echo '<option style="padding-right: 10px;" value="' . esc_attr($name) . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . esc_html($name) . ' (' . $size['width'] . 'x' . $size['height'] . ')</option>'; } ?> </select></p> <p><label for="<?php echo $this->get_field_id('image_alignment'); ?> "><?php _e('Image Alignment', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('image_alignment'); ?> "> <option style="padding-right:10px;" value="">- <?php _e('None', 'genesis'); ?> -</option> <option style="padding-right:10px;" value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option style="padding-right:10px;" value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> </select></p> </div> </div> <div style="float: left; width: 250px; margin-left: 10px;"> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px;"> <p><input id="<?php echo $this->get_field_id('show_title'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_title'); ?> " value="1" <?php checked(1, $instance['show_title']); ?> /> <label for="<?php echo $this->get_field_id('show_title'); ?> "><?php _e('Show Post Title', 'genesis'); ?> </label></p> <p><input id="<?php echo $this->get_field_id('show_byline'); ?> " type="checkbox" name="<?php echo $this->get_field_name('show_byline'); ?> " value="1" <?php checked(1, $instance['show_byline']); ?> /> <label for="<?php echo $this->get_field_id('show_byline'); ?> "><?php _e('Show Post Info', 'genesis'); ?> </label> <input type="text" id="<?php echo $this->get_field_id('post_info'); ?> " name="<?php echo $this->get_field_name('post_info'); ?> " value="<?php echo esc_attr($instance['post_info']); ?> " style="width: 99%;" /> </p> <p><label for="<?php echo $this->get_field_id('show_content'); ?> "><?php _e('Content Type', 'genesis'); ?> :</label> <select id="<?php echo $this->get_field_id('show_content'); ?> " name="<?php echo $this->get_field_name('show_content'); ?> "> <option value="content" <?php selected('content', $instance['show_content']); ?> ><?php _e('Show Content', 'genesis'); ?> </option> <option value="excerpt" <?php selected('excerpt', $instance['show_content']); ?> ><?php _e('Show Excerpt', 'genesis'); ?> </option> <option value="content-limit" <?php selected('content-limit', $instance['show_content']); ?> ><?php _e('Show Content Limit', 'genesis'); ?> </option> <option value="" <?php selected('', $instance['show_content']); ?> ><?php _e('No Content', 'genesis'); ?> </option> </select> <br /><label for="<?php echo $this->get_field_id('content_limit'); ?> "><?php _e('Limit content to', 'genesis'); ?> </label> <input type="text" id="<?php echo $this->get_field_id('image_alignment'); ?> " name="<?php echo $this->get_field_name('content_limit'); ?> " value="<?php echo esc_attr(intval($instance['content_limit'])); ?> " size="3" /> <?php _e('characters', 'genesis'); ?> </p> <p><label for="<?php echo $this->get_field_id('more_text'); ?> "><?php _e('More Text (if applicable)', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_text'); ?> " name="<?php echo $this->get_field_name('more_text'); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /></p> </div> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin-top: 10px;"> <p><?php _e('To display an unordered list of more posts from this category, please fill out the information below', 'genesis'); ?> :</p> <p><label for="<?php echo $this->get_field_id('extra_title'); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('extra_title'); ?> " name="<?php echo $this->get_field_name('extra_title'); ?> " value="<?php echo esc_attr($instance['extra_title']); ?> " style="width:95%;" /></p> <p><label for="<?php echo $this->get_field_id('extra_num'); ?> "><?php _e('Number of Posts to Show', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('extra_num'); ?> " name="<?php echo $this->get_field_name('extra_num'); ?> " value="<?php echo esc_attr($instance['extra_num']); ?> " size="2" /></p> </div> <div style="background: #f1f1f1; border: 1px solid #DDD; padding: 10px 10px 0px 10px; margin: 10px 0;"> <p><input id="<?php echo $this->get_field_id('more_from_category'); ?> " type="checkbox" name="<?php echo $this->get_field_name('more_from_category'); ?> " value="1" <?php checked(1, $instance['more_from_category']); ?> /> <label for="<?php echo $this->get_field_id('more_from_category'); ?> "><?php _e('Show Category Archive Link', 'genesis'); ?> </label></p> <p><label for="<?php echo $this->get_field_id('more_from_category_text'); ?> "><?php _e('Link Text', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('more_from_category_text'); ?> " name="<?php echo $this->get_field_name('more_from_category_text'); ?> " value="<?php echo esc_attr($instance['more_from_category_text']); ?> " style="width:95%;" /></p> </div> </div> <?php }
/** * Return all registered image sizes arrays, including the standard sizes. * * Return a two-dimensional array of standard and additionally registered image sizes, with width, height and crop sub-keys. * * Here, the standard sizes have their sub-keys populated by pulling from the options saved in the database. * * @since 1.0.2 * * @uses genesis_get_additional_image_sizes() Return registered image sizes. * * @return array Two-dimensional, with width, height and crop sub-keys. */ function genesis_get_image_sizes() { $builtin_sizes = array('large' => array('width' => get_option('large_size_w'), 'height' => get_option('large_size_h')), 'medium' => array('width' => get_option('medium_size_w'), 'height' => get_option('medium_size_h')), 'thumbnail' => array('width' => get_option('thumbnail_size_w'), 'height' => get_option('thumbnail_size_h'), 'crop' => get_option('thumbnail_crop'))); $additional_sizes = genesis_get_additional_image_sizes(); return array_merge($builtin_sizes, $additional_sizes); }
function genesis_theme_settings_post_archives_box() { ?> <p><?php _e("Select one of the following:", 'genesis'); ?> <select name="<?php echo GENESIS_SETTINGS_FIELD; ?> [content_archive]"> <option style="padding-right:10px;" value="full" <?php selected('full', genesis_get_option('content_archive')); ?> ><?php _e("Display post content", 'genesis'); ?> </option> <option style="padding-right:10px;" value="excerpts" <?php selected('excerpts', genesis_get_option('content_archive')); ?> ><?php _e("Display post excerpts", 'genesis'); ?> </option> </select></p> <p><label for="<?php echo GENESIS_SETTINGS_FIELD; ?> [content_archive_limit]"><?php _e('Limit content to', 'genesis'); ?> </label> <input type="text" name="<?php echo GENESIS_SETTINGS_FIELD; ?> [content_archive_limit]" id="<?php echo GENESIS_SETTINGS_FIELD; ?> [content_archive_limit]" value="<?php echo esc_attr(genesis_option('content_archive_limit')); ?> " size="3" /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?> [content_archive_limit]"><?php _e('characters', 'genesis'); ?> </label></p> <p><span class="description"><?php _e('<b>NOTE:</b> Using this option will limit the text and strip all formatting from the text displayed. To use this option, choose "Display post content" in the select box above.', 'genesis'); ?> </span></p> <p><input type="checkbox" name="<?php echo GENESIS_SETTINGS_FIELD; ?> [content_archive_thumbnail]" id="<?php echo GENESIS_SETTINGS_FIELD; ?> [content_archive_thumbnail]" value="1" <?php checked(1, genesis_get_option('content_archive_thumbnail')); ?> /> <label for="<?php echo GENESIS_SETTINGS_FIELD; ?> [content_archive_thumbnail]"><?php _e("Include the Featured Image?", 'genesis'); ?> </label> </p> <p><?php _e('Image Size', 'genesis'); ?> : <?php $sizes = genesis_get_additional_image_sizes(); ?> <select name="<?php echo GENESIS_SETTINGS_FIELD; ?> [image_size]"> <option style="padding-right:10px;" value="thumbnail">thumbnail (<?php echo get_option('thumbnail_size_w'); ?> x<?php echo get_option('thumbnail_size_h'); ?> )</option> <?php foreach ((array) $sizes as $name => $size) { echo '<option style="padding-right: 10px;" value="' . $name . '" ' . selected($name, genesis_get_option('image_size'), FALSE) . '>' . $name . ' (' . $size['width'] . 'x' . $size['height'] . ')</option>'; } ?> </select></p> <p><?php _e("Select Post Navigation Technique:", 'genesis'); ?> <select name="<?php echo GENESIS_SETTINGS_FIELD; ?> [posts_nav]"> <option style="padding-right:10px;" value="older-newer" <?php selected('older-newer', genesis_get_option('posts_nav')); ?> ><?php _e("Older / Newer", 'genesis'); ?> </option> <option style="padding-right:10px;" value="prev-next" <?php selected('prev-next', genesis_get_option('posts_nav')); ?> ><?php _e("Previous / Next", 'genesis'); ?> </option> <option style="padding-right:10px;" value="numeric" <?php selected('numeric', genesis_get_option('posts_nav')); ?> ><?php _e("Numeric", 'genesis'); ?> </option> </select></p> <p><span class="description"><?php _e("<b>NOTE:</b> The content archives options will affect any blog listings page, including archive, author, blog, category, search, and tag pages.", 'genesis'); ?> </span></p> <?php }
/** * Echo the settings update form. * * @since 0.1.8 * * @param array $instance Current settings */ function form($instance) { //* Merge with defaults $instance = wp_parse_args((array) $instance, $this->defaults); ?> <p> <label for="<?php echo $this->get_field_id('title'); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo $this->get_field_id('title'); ?> " name="<?php echo esc_attr($this->get_field_name('title')); ?> " value="<?php echo esc_attr($instance['title']); ?> " class="widefat" /> </p> <div class="genesis-widget-column"> <div class="genesis-widget-column-box genesis-widget-column-box-top"> <p> <label for="<?php echo $this->get_field_id('posts_cat'); ?> "><?php _e('Category', 'genesis'); ?> :</label> <?php $categories_args = array('name' => $this->get_field_name('posts_cat'), 'id' => $this->get_field_id('posts_cat'), 'selected' => $instance['posts_cat'], 'orderby' => 'Name', 'hierarchical' => 1, 'show_option_all' => __('All Categories', 'genesis'), 'hide_empty' => '0'); wp_dropdown_categories($categories_args); ?> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('posts_num')); ?> "><?php _e('Number of Posts to Show', 'genesis'); ?> :</label> <input type="text" id="<?php echo esc_attr($this->get_field_id('posts_num')); ?> " name="<?php echo esc_attr($this->get_field_name('posts_num')); ?> " value="<?php echo esc_attr($instance['posts_num']); ?> " size="2" /> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('posts_offset')); ?> "><?php _e('Number of Posts to Offset', 'genesis'); ?> :</label> <input type="text" id="<?php echo esc_attr($this->get_field_id('posts_offset')); ?> " name="<?php echo esc_attr($this->get_field_name('posts_offset')); ?> " value="<?php echo esc_attr($instance['posts_offset']); ?> " size="2" /> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('orderby')); ?> "><?php _e('Order By', 'genesis'); ?> :</label> <select id="<?php echo esc_attr($this->get_field_id('orderby')); ?> " name="<?php echo esc_attr($this->get_field_name('orderby')); ?> "> <option value="date" <?php selected('date', $instance['orderby']); ?> ><?php _e('Date', 'genesis'); ?> </option> <option value="title" <?php selected('title', $instance['orderby']); ?> ><?php _e('Title', 'genesis'); ?> </option> <option value="parent" <?php selected('parent', $instance['orderby']); ?> ><?php _e('Parent', 'genesis'); ?> </option> <option value="ID" <?php selected('ID', $instance['orderby']); ?> ><?php _e('ID', 'genesis'); ?> </option> <option value="comment_count" <?php selected('comment_count', $instance['orderby']); ?> ><?php _e('Comment Count', 'genesis'); ?> </option> <option value="rand" <?php selected('rand', $instance['orderby']); ?> ><?php _e('Random', 'genesis'); ?> </option> </select> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('order')); ?> "><?php _e('Sort Order', 'genesis'); ?> :</label> <select id="<?php echo esc_attr($this->get_field_id('order')); ?> " name="<?php echo esc_attr($this->get_field_name('order')); ?> "> <option value="DESC" <?php selected('DESC', $instance['order']); ?> ><?php _e('Descending (3, 2, 1)', 'genesis'); ?> </option> <option value="ASC" <?php selected('ASC', $instance['order']); ?> ><?php _e('Ascending (1, 2, 3)', 'genesis'); ?> </option> </select> </p> <p> <input id="<?php echo esc_attr($this->get_field_id('exclude_displayed')); ?> " type="checkbox" name="<?php echo esc_attr($this->get_field_name('exclude_displayed')); ?> " value="1" <?php checked($instance['exclude_displayed']); ?> /> <label for="<?php echo esc_attr($this->get_field_id('exclude_displayed')); ?> "><?php _e('Exclude Previously Displayed Posts?', 'genesis'); ?> </label> </p> <p> <input id="<?php echo esc_attr($this->get_field_id('exclude_sticky')); ?> " type="checkbox" name="<?php echo esc_attr($this->get_field_name('exclude_sticky')); ?> " value="1" <?php checked($instance['exclude_sticky']); ?> /> <label for="<?php echo esc_attr($this->get_field_id('exclude_sticky')); ?> "><?php _e('Exclude Sticky Posts?', 'genesis'); ?> </label> </p> </div> <div class="genesis-widget-column-box"> <p> <input id="<?php echo esc_attr($this->get_field_id('show_gravatar')); ?> " type="checkbox" name="<?php echo esc_attr($this->get_field_name('show_gravatar')); ?> " value="1" <?php checked($instance['show_gravatar']); ?> /> <label for="<?php echo esc_attr($this->get_field_id('show_gravatar')); ?> "><?php _e('Show Author Gravatar', 'genesis'); ?> </label> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('gravatar_size')); ?> "><?php _e('Gravatar Size', 'genesis'); ?> :</label> <select id="<?php echo esc_attr($this->get_field_id('gravatar_size')); ?> " name="<?php echo esc_attr($this->get_field_name('gravatar_size')); ?> "> <option value="45" <?php selected(45, $instance['gravatar_size']); ?> ><?php _e('Small (45px)', 'genesis'); ?> </option> <option value="65" <?php selected(65, $instance['gravatar_size']); ?> ><?php _e('Medium (65px)', 'genesis'); ?> </option> <option value="85" <?php selected(85, $instance['gravatar_size']); ?> ><?php _e('Large (85px)', 'genesis'); ?> </option> <option value="125" <?php selected(125, $instance['gravatar_size']); ?> ><?php _e('Extra Large (125px)', 'genesis'); ?> </option> </select> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('gravatar_alignment')); ?> "><?php _e('Gravatar Alignment', 'genesis'); ?> :</label> <select id="<?php echo esc_attr($this->get_field_id('gravatar_alignment')); ?> " name="<?php echo esc_attr($this->get_field_name('gravatar_alignment')); ?> "> <option value="alignnone">- <?php _e('None', 'genesis'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $instance['gravatar_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option value="alignright" <?php selected('alignright', $instance['gravatar_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> </select> </p> </div> <div class="genesis-widget-column-box"> <p> <input id="<?php echo esc_attr($this->get_field_id('show_image')); ?> " type="checkbox" name="<?php echo esc_attr($this->get_field_name('show_image')); ?> " value="1" <?php checked($instance['show_image']); ?> /> <label for="<?php echo esc_attr($this->get_field_id('show_image')); ?> "><?php _e('Show Featured Image', 'genesis'); ?> </label> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('image_size')); ?> "><?php _e('Image Size', 'genesis'); ?> :</label> <select id="<?php echo esc_attr($this->get_field_id('image_size')); ?> " class="genesis-image-size-selector" name="<?php echo esc_attr($this->get_field_name('image_size')); ?> "> <option value="thumbnail">thumbnail (<?php echo esc_html(get_option('thumbnail_size_w')); ?> x<?php echo esc_html(get_option('thumbnail_size_h')); ?> )</option> <?php $sizes = genesis_get_additional_image_sizes(); foreach ((array) $sizes as $name => $size) { #echo '<option value="' . esc_attr( $name ) . '" '. selected( $name, $instance['image_size'], FALSE ) . '>' . esc_html( $name ) . ' ( ' . esc_html( $size['width'] ) . 'x' . esc_html( $size['height'] ) . ' )</option>'; printf('<option value="%s" %s>%s (%sx%s)</option>', esc_attr($name), selected($name, $instance['image_size'], 0), esc_html($name), esc_html($size['width']), esc_html($size['height'])); } ?> </select> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('image_alignment')); ?> "><?php _e('Image Alignment', 'genesis'); ?> :</label> <select id="<?php echo esc_attr($this->get_field_id('image_alignment')); ?> " name="<?php echo esc_attr($this->get_field_name('image_alignment')); ?> "> <option value="alignnone">- <?php _e('None', 'genesis'); ?> -</option> <option value="alignleft" <?php selected('alignleft', $instance['image_alignment']); ?> ><?php _e('Left', 'genesis'); ?> </option> <option value="alignright" <?php selected('alignright', $instance['image_alignment']); ?> ><?php _e('Right', 'genesis'); ?> </option> <option value="aligncenter" <?php selected('aligncenter', $instance['image_alignment']); ?> ><?php _e('Center', 'genesis'); ?> </option> </select> </p> </div> </div> <div class="genesis-widget-column genesis-widget-column-right"> <div class="genesis-widget-column-box genesis-widget-column-box-top"> <p> <input id="<?php echo esc_attr($this->get_field_id('show_title')); ?> " type="checkbox" name="<?php echo esc_attr($this->get_field_name('show_title')); ?> " value="1" <?php checked($instance['show_title']); ?> /> <label for="<?php echo esc_attr($this->get_field_id('show_title')); ?> "><?php _e('Show Post Title', 'genesis'); ?> </label> </p> <p> <input id="<?php echo esc_attr($this->get_field_id('show_byline')); ?> " type="checkbox" name="<?php echo esc_attr($this->get_field_name('show_byline')); ?> " value="1" <?php checked($instance['show_byline']); ?> /> <label for="<?php echo esc_attr($this->get_field_id('show_byline')); ?> "><?php _e('Show Post Info', 'genesis'); ?> </label> <input type="text" id="<?php echo esc_attr($this->get_field_id('post_info')); ?> " name="<?php echo esc_attr($this->get_field_name('post_info')); ?> " value="<?php echo esc_attr($instance['post_info']); ?> " class="widefat" /> <label for="<?php echo esc_attr($this->get_field_id('post_info')); ?> " class="screen-reader-text"><?php _e('Content Post Info', 'genesis'); ?> </label> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('show_content')); ?> "><?php _e('Content Type', 'genesis'); ?> :</label> <select id="<?php echo esc_attr($this->get_field_id('show_content')); ?> " name="<?php echo esc_attr($this->get_field_name('show_content')); ?> "> <option value="content" <?php selected('content', $instance['show_content']); ?> ><?php _e('Show Content', 'genesis'); ?> </option> <option value="excerpt" <?php selected('excerpt', $instance['show_content']); ?> ><?php _e('Show Excerpt', 'genesis'); ?> </option> <option value="content-limit" <?php selected('content-limit', $instance['show_content']); ?> ><?php _e('Show Content Limit', 'genesis'); ?> </option> <option value="" <?php selected('', $instance['show_content']); ?> ><?php _e('No Content', 'genesis'); ?> </option> </select> <br /> <label for="<?php echo esc_attr($this->get_field_id('content_limit')); ?> "><?php _e('Limit content to', 'genesis'); ?> <input type="text" id="<?php echo esc_attr($this->get_field_id('content_limit')); ?> " name="<?php echo esc_attr($this->get_field_name('content_limit')); ?> " value="<?php echo esc_attr(intval($instance['content_limit'])); ?> " size="3" /> <?php _e('characters', 'genesis'); ?> </label> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('more_text')); ?> "><?php _e('More Text (if applicable)', 'genesis'); ?> :</label> <input type="text" id="<?php echo esc_attr($this->get_field_id('more_text')); ?> " name="<?php echo esc_attr($this->get_field_name('more_text')); ?> " value="<?php echo esc_attr($instance['more_text']); ?> " /> </p> </div> <div class="genesis-widget-column-box"> <p id="<?php echo esc_attr($this->get_field_id('extra_title')); ?> -descr"><?php _e('To display an unordered list of more posts from this category, please fill out the information below', 'genesis'); ?> :</p> <p> <label for="<?php echo esc_attr($this->get_field_id('extra_title')); ?> "><?php _e('Title', 'genesis'); ?> :</label> <input type="text" id="<?php echo esc_attr($this->get_field_id('extra_title')); ?> " name="<?php echo esc_attr($this->get_field_name('extra_title')); ?> " value="<?php echo esc_attr($instance['extra_title']); ?> " class="widefat" aria-describedby="<?php echo esc_attr($this->get_field_id('extra_title')); ?> -descr" /> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('extra_num')); ?> "><?php _e('Number of Posts to Show', 'genesis'); ?> :</label> <input type="text" id="<?php echo esc_attr($this->get_field_id('extra_num')); ?> " name="<?php echo esc_attr($this->get_field_name('extra_num')); ?> " value="<?php echo esc_attr($instance['extra_num']); ?> " size="2" /> </p> </div> <div class="genesis-widget-column-box"> <p> <input id="<?php echo esc_attr($this->get_field_id('more_from_category')); ?> " type="checkbox" name="<?php echo esc_attr($this->get_field_name('more_from_category')); ?> " value="1" <?php checked($instance['more_from_category']); ?> /> <label for="<?php echo esc_attr($this->get_field_id('more_from_category')); ?> "><?php _e('Show Category Archive Link', 'genesis'); ?> </label> </p> <p> <label for="<?php echo esc_attr($this->get_field_id('more_from_category_text')); ?> "><?php _e('Link Text', 'genesis'); ?> :</label> <input type="text" id="<?php echo esc_attr($this->get_field_id('more_from_category_text')); ?> " name="<?php echo esc_attr($this->get_field_name('more_from_category_text')); ?> " value="<?php echo esc_attr($instance['more_from_category_text']); ?> " class="widefat" /> </p> </div> </div> <?php }
<label for="<?php echo $this->get_field_id('image_size'); ?> "><?php _e('Image Size', 'genesis-featured-page-extras'); ?> :</label> <select id="<?php echo $this->get_field_id('image_size'); ?> " name="<?php echo $this->get_field_name('image_size'); ?> "> <?php $sizes = genesis_get_additional_image_sizes(); foreach ((array) $sizes as $name => $size) { echo '<option value="' . $name . '" ' . selected($name, $instance['image_size'], FALSE) . '>' . _x('Custom', 'in drop-down select for image sizes', 'genesis-featured-page-extras') . ': ' . $name . ' (' . absint($size['width']) . ' × ' . absint($size['height']) . ')</option>'; } // end foreach ?> <option value="thumbnail" <?php selected('thumbnail', $instance['image_size']); ?> ><?php echo $wp_string; ?> thumbnail (<?php echo absint(get_option('thumbnail_size_w')); ?> × <?php