<?php 
wp_idea_stream_ideas_the_author_avatar();
?>
</div>
<div class="idea-content">

	<?php 
do_action('wp_idea_stream_idea_entry_before_title');
?>

	<div class="idea-title">
		<?php 
wp_idea_stream_ideas_before_idea_title();
?>
<a href="<?php 
wp_idea_stream_ideas_the_permalink();
?>
" title="<?php 
wp_idea_stream_ideas_the_title_attribute();
?>
"><?php 
wp_idea_stream_ideas_the_title();
?>
</a>
	</div>

	<?php 
do_action('wp_idea_stream_idea_entry_before_header');
?>

	<?php 
Example #2
0
        /**
         * Display the widget on front end
         *
         * @package WP Idea Stream
         * @subpackage ideas/widgets
         *
         * @since 2.0.0
         *
         * @uses   apply_filters() call 'widget_title' to override the widget title
         *                         call 'wp_idea_stream_ideas_popular_args' to customize args
         * @uses   wp_idea_stream_set_idea_var() to globalized a value
         * @uses   a new Ideas loop
         * @uses   wp_idea_stream_maybe_reset_postdata() to reset post data
         */
        public function widget($args = array(), $instance = array())
        {
            // Default to comment_count
            $orderby = 'comment_count';
            if (!empty($instance['orderby'])) {
                $orderby = $instance['orderby'];
            }
            // Default per_page is 5
            $number = 5;
            // No nav items to show !? Stop!
            if (!empty($instance['number'])) {
                $number = (int) $instance['number'];
            }
            // Default title is nothing
            $title = '';
            if (!empty($instance['title'])) {
                $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
            }
            echo $args['before_widget'];
            if (!empty($title)) {
                echo $args['before_title'] . $title . $args['after_title'];
            }
            // Popular argumments.
            $idea_args = apply_filters('wp_idea_stream_ideas_popular_args', array('per_page' => $number, 'orderby' => $orderby, 'is_widget' => true));
            if ('rates_count' == $orderby) {
                wp_idea_stream_set_idea_var('rating_widget', true);
            }
            // Display the popular ideas
            if (wp_idea_stream_ideas_has_ideas($idea_args)) {
                ?>

		<ul>

			<?php 
                while (wp_idea_stream_ideas_the_ideas()) {
                    wp_idea_stream_ideas_the_idea();
                    ?>

				<li>
					<a href="<?php 
                    wp_idea_stream_ideas_the_permalink();
                    ?>
" title="<?php 
                    wp_idea_stream_ideas_the_title_attribute();
                    ?>
"><?php 
                    wp_idea_stream_ideas_the_title();
                    ?>
</a>
					<span class="count">
						<?php 
                    if ('comment_count' == $orderby) {
                        ?>
							(<?php 
                        wp_idea_stream_ideas_the_comment_number();
                        ?>
)
						<?php 
                    } else {
                        ?>
							(<?php 
                        wp_idea_stream_ideas_the_average_rating();
                        ?>
)
						<?php 
                    }
                    ?>
					</span>
				</li>

		<?php 
                }
                // Reset post data
                wp_idea_stream_maybe_reset_postdata();
                ?>

		</ul>
		<?php 
            }
            if ('rates_count' == $orderby) {
                wp_idea_stream_set_idea_var('rating_widget', false);
            }
            echo $args['after_widget'];
        }