{This question is marked as duplicate but i think my question and answer to it is much simpler then the original one}
Hi i have this following code that is showing before the widget title. For what i understand from my research is that i have to use return, but its not working. Please help.
<?php
function get_review_code(){
echo '<div class="review-slider-wrap">';
echo '<ul class="review-slider">';
global $post;
$args = array( 'numberposts' => 10, 'category_name' => 'review' );
$posts = get_posts( $args );
foreach( $posts as $post ): setup_postdata($post);
echo '<li>';
echo '<div class="white-curve">';
echo the_excerpt();
$author_id=$post->post_author;
echo '<div class="author_full_name">';
echo '- ';
echo the_author_meta('first_name'); echo ' ';
echo the_author_meta('last_name');
echo '</div>';
echo '</div>';
echo get_avatar( $post->post_author, 230 );
echo '</li>';
endforeach;
echo '</ul>';
echo '</div>';
}
add_shortcode('review_review', 'get_review_code');