Advertisement
Guest User

Untitled

a guest
Oct 24th, 2013
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 20.34 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Genesis Framework.
  4.  *
  5.  * WARNING: This file is part of the core Genesis Framework. DO NOT edit this file under any circumstances.
  6.  * Please do all modifications in the form of a child theme.
  7.  *
  8.  * @package Genesis\Widgets
  9.  * @author  StudioPress
  10.  * @license GPL-2.0+
  11.  * @link    http://my.studiopress.com/themes/genesis/
  12.  */
  13.  
  14. /**
  15.  * Genesis Featured Post widget class.
  16.  *
  17.  * @since 0.1.8
  18.  *
  19.  * @package Genesis\Widgets
  20.  */
  21. class Genesis_Featured_Post extends WP_Widget {
  22.  
  23.     /**
  24.      * Holds widget settings defaults, populated in constructor.
  25.      *
  26.      * @var array
  27.      */
  28.     protected $defaults;
  29.  
  30.     /**
  31.      * Constructor. Set the default widget options and create widget.
  32.      *
  33.      * @since 0.1.8
  34.      */
  35.     function __construct() {
  36.  
  37.         $this->defaults = array(
  38.             'title'                   => '',
  39.             'posts_cat'               => '',
  40.             'posts_num'               => 1,
  41.             'posts_offset'            => 0,
  42.             'orderby'                 => '',
  43.             'order'                   => '',
  44.             'exclude_displayed'       => 0,
  45.             'show_image'              => 0,
  46.             'image_alignment'         => '',
  47.             'image_size'              => '',
  48.             'show_gravatar'           => 0,
  49.             'gravatar_alignment'      => '',
  50.             'gravatar_size'           => '',
  51.             'show_title'              => 0,
  52.             'show_byline'             => 0,
  53.             'post_info'               => '[post_date] ' . __( 'By', 'genesis' ) . ' [post_author_posts_link] [post_comments]',
  54.             'show_content'            => 'excerpt',
  55.             'content_limit'           => '',
  56.             'more_text'               => __( '[Read More...]', 'genesis' ),
  57.             'extra_num'               => '',
  58.             'extra_title'             => '',
  59.             'more_from_category'      => '',
  60.             'more_from_category_text' => __( 'More Posts from this Category', 'genesis' ),
  61.         );
  62.  
  63.         $widget_ops = array(
  64.             'classname'   => 'featured-content featuredpost',
  65.             'description' => __( 'Displays featured posts with thumbnails', 'genesis' ),
  66.         );
  67.  
  68.         $control_ops = array(
  69.             'id_base' => 'featured-post',
  70.             'width'   => 505,
  71.             'height'  => 350,
  72.         );
  73.  
  74.         parent::__construct( 'featured-post', __( 'Genesis - Featured Posts', 'genesis' ), $widget_ops, $control_ops );
  75.  
  76.     }
  77.  
  78.     /**
  79.      * Echo the widget content.
  80.      *
  81.      * @since 0.1.8
  82.      *
  83.      * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
  84.      * @param array $instance The settings for the particular instance of the widget
  85.      */
  86.     function widget( $args, $instance ) {
  87.  
  88.         global $wp_query, $_genesis_displayed_ids;
  89.  
  90.         extract( $args );
  91.  
  92.         //* Merge with defaults
  93.         $instance = wp_parse_args( (array) $instance, $this->defaults );
  94.  
  95.         echo $before_widget;
  96.  
  97.         //* Set up the author bio
  98.         if ( ! empty( $instance['title'] ) )
  99.             echo $before_title . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $after_title;
  100.  
  101.         $query_args = array(
  102.             'post_type' => 'post',
  103.             'cat'       => $instance['posts_cat'],
  104.             'showposts' => $instance['posts_num'],
  105.             'offset'    => $instance['posts_offset'],
  106.             'orderby'   => $instance['orderby'],
  107.             'order'     => $instance['order'],
  108.         );
  109.  
  110.         //* Exclude displayed IDs from this loop?
  111.         if ( $instance['exclude_displayed'] )
  112.             $query_args['post__not_in'] = (array) $_genesis_displayed_ids;
  113.         $counter = 1;
  114.         $wp_query = new WP_Query( $query_args );
  115.  
  116.         if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  117.         <div class="class-<?php echo $counter;?>">
  118.             <?php $_genesis_displayed_ids[] = get_the_ID();
  119.  
  120.             genesis_markup( array(
  121.                 'html5'   => '<article %s>',
  122.                 'xhtml'   => sprintf( '<div class="%s">', implode( ' ', get_post_class() ) ),
  123.                 'context' => 'entry',
  124.             ) );
  125.  
  126.             $image = genesis_get_image( array(
  127.                 'format'  => 'html',
  128.                 'size'    => $instance['image_size'],
  129.                 'context' => 'featured-post-widget',
  130.                 'attr'    => genesis_parse_attr( 'entry-image-widget' ),
  131.             ) );
  132.            
  133.            
  134.                 if ( ! empty( $instance['show_title'] ) ) {
  135.                    
  136.                     if ( genesis_html5() )
  137.                         printf( '<h2 class="entry-title"><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute( 'echo=0' ), get_the_title() );
  138.                     else
  139.                         printf( '<h2><a href="%s" title="%s">%s</a></h2>', get_permalink(), the_title_attribute( 'echo=0' ), get_the_title() );
  140.                
  141.                 }
  142.             echo '<div class="featured-image">';
  143.             if ( $instance['show_image'] && $image )
  144.                 printf( '<a href="%s" title="%s" class="%s">%s</a>', get_permalink(), the_title_attribute( 'echo=0' ), esc_attr( $instance['image_alignment'] ), $image );
  145.             $my_var = get_comments_number( $post_id );
  146.             if ($my_var == 0){ ?>
  147.             <div class="the-comment"><a href="<?php comments_link();?>">0</a></div>
  148.             <?php }
  149.             else{ ?>
  150.             <div class='the-comment'><a href="<?php comments_link();?>"><?php echo $my_var?></a></div>
  151.             <?php }
  152.             echo '</div>';
  153.                 if ( ! empty( $instance['show_gravatar'] ) ) {
  154.                     echo '<span class="' . esc_attr( $instance['gravatar_alignment'] ) . '">';
  155.                     echo get_avatar( get_the_author_meta( 'ID' ), $instance['gravatar_size'] );
  156.                     echo '</span>';
  157.                 }
  158.  
  159.                 if ( $instance['show_title'] )
  160.                 echo genesis_html5() ? '<header class="entry-header">' : '';
  161.  
  162.                 if ( $instance['show_title'] )
  163.                     echo genesis_html5() ? '</header>' : '';
  164.  
  165.                 if ( ! empty( $instance['show_content'] ) ) {
  166.  
  167.                 echo genesis_html5() ? '<div class="entry-content">' : '';
  168.  
  169.                 if ( 'excerpt' == $instance['show_content'] ) {
  170.                     the_excerpt();
  171.                 }
  172.                 elseif ( 'content-limit' == $instance['show_content'] ) {
  173.                     the_content_limit( (int) $instance['content_limit'], esc_html( $instance['more_text'] ) );
  174.                 }
  175.                 else {
  176.  
  177.                     global $more;
  178.  
  179.                     $orig_more = $more;
  180.                     $more = 0;
  181.  
  182.                     the_content( esc_html( $instance['more_text'] ) );
  183.  
  184.                     $more = $orig_more;
  185.  
  186.                 }
  187.                 if ( ! empty( $instance['show_byline'] ) && ! empty( $instance['post_info'] ) )
  188.                 printf( genesis_html5() ? '<p class="entry-meta">%s</p>' : '<p class="byline post-info">%s</p>', do_shortcode( $instance['post_info'] ) );
  189.                 echo genesis_html5() ? '</div>' : '';
  190.  
  191.                 }
  192.  
  193.             genesis_markup( array(
  194.                 'html5' => '</article>',
  195.                 'xhtml' => '</div>',
  196.             ) );
  197. echo '</div>';
  198.          if ( $counter == 4 ) { $counter = 1; } else { $counter += 1; }
  199.         endwhile; endif;
  200.  
  201.         //* Restore original query
  202.         wp_reset_query();
  203.        
  204.         //* The EXTRA Posts (list)
  205.         if ( ! empty( $instance['extra_num'] ) ) {
  206.             if ( ! empty( $instance['extra_title'] ) )
  207.                 echo $before_title . esc_html( $instance['extra_title'] ) . $after_title;
  208.  
  209.             $offset = intval( $instance['posts_num'] ) + intval( $instance['posts_offset'] );
  210.  
  211.             $query_args = array(
  212.                 'cat'       => $instance['posts_cat'],
  213.                 'showposts' => $instance['extra_num'],
  214.                 'offset'    => $offset,
  215.             );
  216.  
  217.             $wp_query = new WP_Query( $query_args );
  218.  
  219.             $listitems = '';
  220.  
  221.             if ( have_posts() ) {
  222.                 while ( have_posts() ) {
  223.                     the_post();
  224.                     $_genesis_displayed_ids[] = get_the_ID();
  225.                     $listitems .= sprintf( '<li><a href="%s" title="%s">%s</a></li>', get_permalink(), the_title_attribute( 'echo=0' ), get_the_title() );
  226.                 }
  227.  
  228.                 if ( mb_strlen( $listitems ) > 0 )
  229.                     printf( '<ul>%s</ul>', $listitems );
  230.             }
  231.  
  232.             //* Restore original query
  233.             wp_reset_query();
  234.         }
  235.  
  236.         if ( ! empty( $instance['more_from_category'] ) && ! empty( $instance['posts_cat'] ) )
  237.             printf(
  238.                 '<p class="more-from-category"><a href="%1$s" title="%2$s">%3$s</a></p>',
  239.                 esc_url( get_category_link( $instance['posts_cat'] ) ),
  240.                 esc_attr( get_cat_name( $instance['posts_cat'] ) ),
  241.                 esc_html( $instance['more_from_category_text'] )
  242.             );
  243.  
  244.         echo $after_widget;
  245.  
  246.     }
  247.  
  248.     /**
  249.      * Update a particular instance.
  250.      *
  251.      * This function should check that $new_instance is set correctly.
  252.      * The newly calculated value of $instance should be returned.
  253.      * If "false" is returned, the instance won't be saved/updated.
  254.      *
  255.      * @since 0.1.8
  256.      *
  257.      * @param array $new_instance New settings for this instance as input by the user via form()
  258.      * @param array $old_instance Old settings for this instance
  259.      * @return array Settings to save or bool false to cancel saving
  260.      */
  261.     function update( $new_instance, $old_instance ) {
  262.  
  263.         $new_instance['title']     = strip_tags( $new_instance['title'] );
  264.         $new_instance['more_text'] = strip_tags( $new_instance['more_text'] );
  265.         $new_instance['post_info'] = wp_kses_post( $new_instance['post_info'] );
  266.         return $new_instance;
  267.  
  268.     }
  269.  
  270.     /**
  271.      * Echo the settings update form.
  272.      *
  273.      * @since 0.1.8
  274.      *
  275.      * @param array $instance Current settings
  276.      */
  277.     function form( $instance ) {
  278.  
  279.         //* Merge with defaults
  280.         $instance = wp_parse_args( (array) $instance, $this->defaults );
  281.  
  282.         ?>
  283.         <p>
  284.             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'genesis' ); ?>:</label>
  285.             <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" />
  286.         </p>
  287.  
  288.         <div class="genesis-widget-column">
  289.  
  290.             <div class="genesis-widget-column-box genesis-widget-column-box-top">
  291.  
  292.                 <p>
  293.                     <label for="<?php echo $this->get_field_id( 'posts_cat' ); ?>"><?php _e( 'Category', 'genesis' ); ?>:</label>
  294.                     <?php
  295.                     $categories_args = array(
  296.                         'name'            => $this->get_field_name( 'posts_cat' ),
  297.                         'selected'        => $instance['posts_cat'],
  298.                         'orderby'         => 'Name',
  299.                         'hierarchical'    => 1,
  300.                         'show_option_all' => __( 'All Categories', 'genesis' ),
  301.                         'hide_empty'      => '0',
  302.                     );
  303.                     wp_dropdown_categories( $categories_args ); ?>
  304.                 </p>
  305.  
  306.                 <p>
  307.                     <label for="<?php echo $this->get_field_id( 'posts_num' ); ?>"><?php _e( 'Number of Posts to Show', 'genesis' ); ?>:</label>
  308.                     <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" />
  309.                 </p>
  310.  
  311.                 <p>
  312.                     <label for="<?php echo $this->get_field_id( 'posts_offset' ); ?>"><?php _e( 'Number of Posts to Offset', 'genesis' ); ?>:</label>
  313.                     <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" />
  314.                 </p>
  315.  
  316.                 <p>
  317.                     <label for="<?php echo $this->get_field_id( 'orderby' ); ?>"><?php _e( 'Order By', 'genesis' ); ?>:</label>
  318.                     <select id="<?php echo $this->get_field_id( 'orderby' ); ?>" name="<?php echo $this->get_field_name( 'orderby' ); ?>">
  319.                         <option value="date" <?php selected( 'date', $instance['orderby'] ); ?>><?php _e( 'Date', 'genesis' ); ?></option>
  320.                         <option value="title" <?php selected( 'title', $instance['orderby'] ); ?>><?php _e( 'Title', 'genesis' ); ?></option>
  321.                         <option value="parent" <?php selected( 'parent', $instance['orderby'] ); ?>><?php _e( 'Parent', 'genesis' ); ?></option>
  322.                         <option value="ID" <?php selected( 'ID', $instance['orderby'] ); ?>><?php _e( 'ID', 'genesis' ); ?></option>
  323.                         <option value="comment_count" <?php selected( 'comment_count', $instance['orderby'] ); ?>><?php _e( 'Comment Count', 'genesis' ); ?></option>
  324.                         <option value="rand" <?php selected( 'rand', $instance['orderby'] ); ?>><?php _e( 'Random', 'genesis' ); ?></option>
  325.                     </select>
  326.                 </p>
  327.  
  328.                 <p>
  329.                     <label for="<?php echo $this->get_field_id( 'order' ); ?>"><?php _e( 'Sort Order', 'genesis' ); ?>:</label>
  330.                     <select id="<?php echo $this->get_field_id( 'order' ); ?>" name="<?php echo $this->get_field_name( 'order' ); ?>">
  331.                         <option value="DESC" <?php selected( 'DESC', $instance['order'] ); ?>><?php _e( 'Descending (3, 2, 1)', 'genesis' ); ?></option>
  332.                         <option value="ASC" <?php selected( 'ASC', $instance['order'] ); ?>><?php _e( 'Ascending (1, 2, 3)', 'genesis' ); ?></option>
  333.                     </select>
  334.                 </p>
  335.  
  336.                 <p>
  337.                     <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'] ); ?>/>
  338.                     <label for="<?php echo $this->get_field_id( 'exclude_displayed' ); ?>"><?php _e( 'Exclude Previously Displayed Posts?', 'genesis' ); ?></label>
  339.                 </p>
  340.  
  341.             </div>
  342.  
  343.             <div class="genesis-widget-column-box">
  344.  
  345.                 <p>
  346.                     <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'] ); ?>/>
  347.                     <label for="<?php echo $this->get_field_id( 'show_gravatar' ); ?>"><?php _e( 'Show Author Gravatar', 'genesis' ); ?></label>
  348.                 </p>
  349.  
  350.                 <p>
  351.                     <label for="<?php echo $this->get_field_id( 'gravatar_size' ); ?>"><?php _e( 'Gravatar Size', 'genesis' ); ?>:</label>
  352.                     <select id="<?php echo $this->get_field_id( 'gravatar_size' ); ?>" name="<?php echo $this->get_field_name( 'gravatar_size' ); ?>">
  353.                         <option value="45" <?php selected( 45, $instance['gravatar_size'] ); ?>><?php _e( 'Small (45px)', 'genesis' ); ?></option>
  354.                         <option value="65" <?php selected( 65, $instance['gravatar_size'] ); ?>><?php _e( 'Medium (65px)', 'genesis' ); ?></option>
  355.                         <option value="85" <?php selected( 85, $instance['gravatar_size'] ); ?>><?php _e( 'Large (85px)', 'genesis' ); ?></option>
  356.                         <option value="125" <?php selected( 105, $instance['gravatar_size'] ); ?>><?php _e( 'Extra Large (125px)', 'genesis' ); ?></option>
  357.                     </select>
  358.                 </p>
  359.  
  360.                 <p>
  361.                     <label for="<?php echo $this->get_field_id( 'gravatar_alignment' ); ?>"><?php _e( 'Gravatar Alignment', 'genesis' ); ?>:</label>
  362.                     <select id="<?php echo $this->get_field_id( 'gravatar_alignment' ); ?>" name="<?php echo $this->get_field_name( 'gravatar_alignment' ); ?>">
  363.                         <option value="alignnone">- <?php _e( 'None', 'genesis' ); ?> -</option>
  364.                         <option value="alignleft" <?php selected( 'alignleft', $instance['gravatar_alignment'] ); ?>><?php _e( 'Left', 'genesis' ); ?></option>
  365.                         <option value="alignright" <?php selected( 'alignright', $instance['gravatar_alignment'] ); ?>><?php _e( 'Right', 'genesis' ); ?></option>
  366.                     </select>
  367.                 </p>
  368.  
  369.             </div>
  370.  
  371.             <div class="genesis-widget-column-box">
  372.  
  373.                 <p>
  374.                     <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'] ); ?>/>
  375.                     <label for="<?php echo $this->get_field_id( 'show_image' ); ?>"><?php _e( 'Show Featured Image', 'genesis' ); ?></label>
  376.                 </p>
  377.  
  378.                 <p>
  379.                     <label for="<?php echo $this->get_field_id( 'image_size' ); ?>"><?php _e( 'Image Size', 'genesis' ); ?>:</label>
  380.                     <select id="<?php echo $this->get_field_id( 'image_size' ); ?>" class="genesis-image-size-selector" name="<?php echo $this->get_field_name( 'image_size' ); ?>">
  381.                         <option value="thumbnail">thumbnail (<?php echo get_option( 'thumbnail_size_w' ); ?>x<?php echo get_option( 'thumbnail_size_h' ); ?>)</option>
  382.                         <?php
  383.                         $sizes = genesis_get_additional_image_sizes();
  384.                         foreach( (array) $sizes as $name => $size )
  385.                             echo '<option value="'.esc_attr( $name ).'" '.selected( $name, $instance['image_size'], FALSE ).'>'.esc_html( $name ).' ( '.$size['width'].'x'.$size['height'].' )</option>';
  386.                         ?>
  387.                     </select>
  388.                 </p>
  389.  
  390.                 <p>
  391.                     <label for="<?php echo $this->get_field_id( 'image_alignment' ); ?>"><?php _e( 'Image Alignment', 'genesis' ); ?>:</label>
  392.                     <select id="<?php echo $this->get_field_id( 'image_alignment' ); ?>" name="<?php echo $this->get_field_name( 'image_alignment' ); ?>">
  393.                         <option value="alignnone">- <?php _e( 'None', 'genesis' ); ?> -</option>
  394.                         <option value="alignleft" <?php selected( 'alignleft', $instance['image_alignment'] ); ?>><?php _e( 'Left', 'genesis' ); ?></option>
  395.                         <option value="alignright" <?php selected( 'alignright', $instance['image_alignment'] ); ?>><?php _e( 'Right', 'genesis' ); ?></option>
  396.                     </select>
  397.                 </p>
  398.  
  399.             </div>
  400.  
  401.         </div>
  402.  
  403.         <div class="genesis-widget-column genesis-widget-column-right">
  404.  
  405.             <div class="genesis-widget-column-box genesis-widget-column-box-top">
  406.  
  407.                 <p>
  408.                     <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'] ); ?>/>
  409.                     <label for="<?php echo $this->get_field_id( 'show_title' ); ?>"><?php _e( 'Show Post Title', 'genesis' ); ?></label>
  410.                 </p>
  411.  
  412.                 <p>
  413.                     <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'] ); ?>/>
  414.                     <label for="<?php echo $this->get_field_id( 'show_byline' ); ?>"><?php _e( 'Show Post Info', 'genesis' ); ?></label>
  415.                     <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" />
  416.                 </p>
  417.  
  418.                 <p>
  419.                     <label for="<?php echo $this->get_field_id( 'show_content' ); ?>"><?php _e( 'Content Type', 'genesis' ); ?>:</label>
  420.                     <select id="<?php echo $this->get_field_id( 'show_content' ); ?>" name="<?php echo $this->get_field_name( 'show_content' ); ?>">
  421.                         <option value="content" <?php selected( 'content', $instance['show_content'] ); ?>><?php _e( 'Show Content', 'genesis' ); ?></option>
  422.                         <option value="excerpt" <?php selected( 'excerpt', $instance['show_content'] ); ?>><?php _e( 'Show Excerpt', 'genesis' ); ?></option>
  423.                         <option value="content-limit" <?php selected( 'content-limit', $instance['show_content'] ); ?>><?php _e( 'Show Content Limit', 'genesis' ); ?></option>
  424.                         <option value="" <?php selected( '', $instance['show_content'] ); ?>><?php _e( 'No Content', 'genesis' ); ?></option>
  425.                     </select>
  426.                     <br />
  427.                     <label for="<?php echo $this->get_field_id( 'content_limit' ); ?>"><?php _e( 'Limit content to', 'genesis' ); ?>
  428.                         <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" />
  429.                         <?php _e( 'characters', 'genesis' ); ?>
  430.                     </label>
  431.                 </p>
  432.  
  433.                 <p>
  434.                     <label for="<?php echo $this->get_field_id( 'more_text' ); ?>"><?php _e( 'More Text (if applicable)', 'genesis' ); ?>:</label>
  435.                     <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'] ); ?>" />
  436.                 </p>
  437.  
  438.             </div>
  439.  
  440.             <div class="genesis-widget-column-box">
  441.  
  442.                 <p><?php _e( 'To display an unordered list of more posts from this category, please fill out the information below', 'genesis' ); ?>:</p>
  443.  
  444.                 <p>
  445.                     <label for="<?php echo $this->get_field_id( 'extra_title' ); ?>"><?php _e( 'Title', 'genesis' ); ?>:</label>
  446.                     <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" />
  447.                 </p>
  448.  
  449.                 <p>
  450.                     <label for="<?php echo $this->get_field_id( 'extra_num' ); ?>"><?php _e( 'Number of Posts to Show', 'genesis' ); ?>:</label>
  451.                     <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" />
  452.                 </p>
  453.  
  454.             </div>
  455.  
  456.             <div class="genesis-widget-column-box">
  457.  
  458.                 <p>
  459.                     <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'] ); ?>/>
  460.                     <label for="<?php echo $this->get_field_id( 'more_from_category' ); ?>"><?php _e( 'Show Category Archive Link', 'genesis' ); ?></label>
  461.                 </p>
  462.  
  463.                 <p>
  464.                     <label for="<?php echo $this->get_field_id( 'more_from_category_text' ); ?>"><?php _e( 'Link Text', 'genesis' ); ?>:</label>
  465.                     <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" />
  466.                 </p>
  467.  
  468.             </div>
  469.  
  470.         </div>
  471.         <?php
  472.  
  473.     }
  474.  
  475. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement