Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8262791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:52:20+00:00 2026-06-08T03:52:20+00:00

Im creating one widget for wordpress website and i need to get multiple values

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:52:22+00:00Added an answer on June 8, 2026 at 3:52 am

    You want to build a string with your required output and return that:

    function function_name() {
        $str = "";
    
        if($tweets) : foreach($tweets as $t) : ?>
            $str .= "<div class="vf-tweet">";
            /** Do the same for the rest of the code above **/
    
        return $str;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

am creating one application for student. I need to show digital clock with remaining
I am creating one GUI in swing Java. I have to use one button
I am creating one application for student. I need to set the different message
My code for creating the data table looks like this: myDataTable = new YAHOO.widget.ScrollingDataTable(
I am creating a web application and I want to use the Tabs widget
I have a JavaScript widget which provides standard extension points. One of them is
I am creating one form in html using table. Which have one Drop down
I am creating one asp page. In that page i defined one property like
I've creating one ASP web application, in that application one form have to update
I am creating one application in which i am using jsp/servlet.. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.