You are returning inside your loop – so it returns on the first iteration, giving you one result only.
You should build a string inside your loop instead, and only return when the loop is over.
Something like
$featured_properties="";
if( $featured_query->have_posts() ):
while( $featured_query->have_posts() ) : $featured_query->the_post();
$featured_properties .= get_the_title() . '<br />';
endwhile;
endif; wp_reset_query();
return $featured_properties;
Related Posts:
- Function to show only first instance of shortcode
- Output loop to function return?
- How do grab the main loop, with conditions, and output via shortcodes
- Creating mixture of shortcodes to use in the visual/text editor
- Use AJAX in shortcode
- How to add attributes to a shortcode
- How to display random users with avatars
- AJAX handler throws 400 (Bad request) – why?
- How to display the_post_thumbnail if a post has one or otherwise display the first image in a post?
- Can shortcodes contain conditional statements? Even without them my shortcode renders blank page
- Creating a table from shortcode avoiding wpautop for each row
- Stripping shortcode from custom excerpt function
- Most elegant way to enqueue scripts in function.php with foreach loop
- Shortcode with custom content attribute?
- Shortcode to insert menu in page body?
- Passing HTML in WordPress Shortcode arguments
- Adding WooCommerce to a Custom Theme – not working [closed]
- Display a text message if the shortcode is found?
- Automatically insert php function into post $the_content
- Filtering posts by category name based on page’s slug
- How would I create a shortcode to display a custom post within a page or regular post?
- Super simple shortcode not working
- 2 Loops, Only Displaying 1 Loop in Both Loops
- Display gallery on top before content
- How to extract the variables out from “add_shortcode” function?
- How to get specified parent page title in my function
- Possible to display shortcode based on the category?
- Shortcode pagination not advancing
- Having a Function Inside of the Loop
- Display post shortcode content in the sidebar?
- Getting different functions data while using while loop in wordpress
- How to get the index number of the posts?
- Using shortcode content with nested shortcode
- Limit length of first excerpt in the loop
- Custom shortcodes not inserting into visual composer columns
- How to filter $content in shortcode function
- Adding a colorbutton in tinymce dialog with current api
- Display gallery on bottom after content
- Excerpts are not displayed by a shortcode on category pages
- WordPress Shortcode function display outside of widget
- Why doesn’t is_page(id) work in functions.php?
- check if the user is owner of current page
- shortcode help require
- Use html inside shortcode function
- Shotcode argument issues
- Exclude category from shortcode
- Visual Composer creating own shortcodes with vc_map() to return simple Image
- get_pages() Returns Only One Item
- Function shortcode – Set Parameter
- Adding an option to a shortcode
- How to use author meta in shortcode?
- Using multiple line variable inside a function?
- Use a shortcode to display custom meta box contents
- How to echo the value of an array element using a function via a shortcode
- Wp-query Order By problem
- issue with if/elseif in_array inside foreach loop display only one post
- How to parse a shortcode within a shortcode?
- Variables not showing in short code
- Genesis Framework: How to exclude a specific author from archive custom loop
- How to create shortcode with html and php content?
- Tracking the number of shortcodes for a list?
- posts within custom post type all share the same content in the front-end
- Shortcode question
- Can I include a custom PHP function in a WordPress function?
- How to create a shortcode out of a php function
- Shortcode to get featured image of specific id post
- Breaking up multiple words and inserting an image after first word
- Problem with shortcode inside a shortcode
- Get Posts List of Current Selected Custom Taxonomy in Shortcode
- Need help making a short code work
- Using One Function To Create Two Different Shortcodes
- Display a list of random terms from custom taxonomy with shortcode
- the_date() and the_time() functions display actual date an time instead of published date and time
- page shows short code not output
- Last updated posts shortcode in functions.php
- How set a while with a function
- Pass post ID from archive template to functions file
- Prevent function from triggering on current page
- How to retrieve image IDs from shortcode content?
- Display list of pages that contain a certain string within the slug
- HowTo: Add wrapper to columns shortcode?
- How To Show Shortcodes In WordPress Custom Fields?
- Shortcode Function – Can’t get anything else to return after running shortcode within shortcode
- Custom shortcode with do_shortcode and substr
- Can I use a function to return HTML and the result of another function?
- Expanding a function to call a plugin or show a link
- Function to get the name in database table from the comma separated string
- Trying to the deduce shortcode from a function
- How to display data from custom fields in my custom shortcode?
- Modify function Shortcode_atts
- restrict access to specific urls on a specific period of time
- Run function from parent on child site
- Way of getting queried loop before the query with a filter hook?
- Add title & subtitle to shortcodes
- Post variables not displaying correctly in custom function
- Shortcode Variations?
- shortcode inside post called by ID does not render as expected
- Custom shortcode not being included in content paragraph [duplicate]
- Display function from functions.php in tag.php
- multible shortcodes (for differnt values) with one function