Im creating one widget for wordpress website and i need to get multiple values in function and return them with return function on website. If i dont use return code wont appear inside div’s
Here is my code for widget
if($tweets) : foreach($tweets as $t) : ?>
<div class="vf-tweet">
<img src="<?php echo $t['image']; ?>" width="36" height="36" alt="" />
<div class="vf-tweet-inner">
<?php echo $t['text']; ?> |
<span class="vf-tweet-time"><?php echo human_time_diff($t['time'], current_time('timestamp')); ?> ago</span>
</div><!-- /vf-tweet-inner -->
</div>
<?php endforeach; ?>
<a href="http://twitter.com/#!/<?php echo $name; ?>">[ Follow us on Twitter ]</a>
<?php else : ?>
<p><?php _e('No tweets found.', 'vt-translate') ?></p>
<?php endif;
and i need to return this by using return function but im little stuck i dont know how to deal with this.
You want to build a string with your required output and return that: