diff --git a/includes/class-displayfeaturedimagegenesis.php b/includes/class-displayfeaturedimagegenesis.php
index c973ffc..976c336 100644
--- a/includes/class-displayfeaturedimagegenesis.php
+++ b/includes/class-displayfeaturedimagegenesis.php
@@ -224,6 +224,7 @@ class Display_Featured_Image_Genesis {
function register_widgets() {
$files = array(
+ 'author',
'cpt-archive',
'taxonomy',
);
@@ -235,6 +236,7 @@ class Display_Featured_Image_Genesis {
if ( function_exists( 'is_customize_preview' ) && is_customize_preview() && ! function_exists( 'genesis' ) ) {
return;
}
+ register_widget( 'Display_Featured_Image_Genesis_Author_Widget' );
register_widget( 'Display_Featured_Image_Genesis_Widget_Taxonomy' );
register_widget( 'Display_Featured_Image_Genesis_Widget_CPT' );
diff --git a/includes/widgets/displayfeaturedimagegenesis-author-widget.php b/includes/widgets/displayfeaturedimagegenesis-author-widget.php
new file mode 100644
index 0000000..84f5d2e
--- /dev/null
+++ b/includes/widgets/displayfeaturedimagegenesis-author-widget.php
@@ -0,0 +1,234 @@
+defaults = array(
+ 'title' => '',
+ 'show_featured_image' => 0,
+ 'featured_image_alignment' => '',
+ 'featured_image_size' => 'medium',
+ 'gravatar_alignment' => 'left',
+ 'user' => '',
+ 'show_gravatar' => 0,
+ 'size' => '45',
+ 'author_info' => '',
+ 'bio_text' => '',
+ 'page' => '',
+ 'page_link_text' => __( 'Read More', 'display-featured-image-genesis' ) . '…',
+ 'posts_link' => '',
+ );
+
+ $widget_ops = array(
+ 'classname' => 'author-profile',
+ 'description' => __( 'Displays user profile block with Gravatar', 'display-featured-image-genesis' ),
+ );
+
+ $control_ops = array(
+ 'id_base' => 'featured-author',
+ 'width' => 200,
+ 'height' => 250,
+ );
+
+ parent::__construct( 'featured-author', __( 'Display Featured Author Profile', 'display-featured-image-genesis' ), $widget_ops, $control_ops );
+
+ }
+
+ /**
+ * Echo the widget content.
+ *
+ * @param array $args Display arguments including before_title, after_title, before_widget, and after_widget.
+ * @param array $instance The settings for the particular instance of the widget
+ */
+ function widget( $args, $instance ) {
+
+ // Merge with defaults
+ $instance = wp_parse_args( (array) $instance, $this->defaults );
+
+ echo $args['before_widget'];
+
+ if ( ! empty( $instance['title'] ) ) {
+ echo $args['before_title'] . apply_filters( 'widget_title', $instance['title'], $instance, $this->id_base ) . $args['after_title'];
+ }
+
+ if ( $instance['show_featured_image'] ) {
+ $image_id = get_the_author_meta( 'displayfeaturedimagegenesis', $instance['user'] );
+ $image_src = wp_get_attachment_image_src( $image_id, $instance['featured_image_size'] );
+ if ( $image_src ) {
+ echo '';
+ }
+ }
+
+ $text = '';
+
+ if ( $instance['show_gravatar'] ) {
+ if ( ! empty( $instance['gravatar_alignment'] ) ) {
+ $text .= '';
+ }
+
+ $text .= get_avatar( $instance['user'], $instance['size'] );
+
+ if( ! empty( $instance['gravatar_alignment'] ) ) {
+ $text .= '';
+ }
+ }
+
+ $text .= 'text' === $instance['author_info'] ? $instance['bio_text'] : get_the_author_meta( 'description', $instance['user'] );
+
+ $text .= $instance['page'] ? sprintf( ' %s', get_page_link( $instance['page'] ), $instance['page_link_text'] ) : '';
+
+ // Echo $text
+ echo wpautop( $text );
+
+ // If posts link option checked, add posts link to output
+ $display_name = get_the_author_meta( 'display_name', $instance['user'] );
+ $user_name = ( ! empty ( $display_name ) && genesis_a11y() ) ? '' . $display_name. ': ' : '';
+
+ if ( $instance['posts_link'] ) {
+ printf( '
+ + +
+ +
+
+ 'authors', 'name' => $this->get_field_name( 'user' ), 'selected' => $instance['user'] ) ); ?>
+