The problem was the double quotes which are needed in normal shortcode usage in posts and pages for some reason when using do_shortcode the double quotes in the attributes where breaking the function. Working code below
<div>
<?php
$lat = get_field('woo_maps_lat');
$long = get_field('woo_maps_long');
echo do_shortcode('[forecast location=' . $lat .','.$long. ']');
?>
</div>
Related Posts:
- How to add Shortcode (font awesome) in widget title?
- WordPress menu deletes when trying to add a hook
- PHP contact form returns warning in text widget [closed]
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- How to edit a widget code?
- Return HTML Template Page with PHP Function
- Is there a way to parse shortcodes in PHP?
- Retrieve multiple values passed to a single attribute in a shortcode
- How to get the registered sidebar’s name by its id?
- ob_get_clean returns empty string, ob_get_flush outputs string
- Export User Info to CSV from Front End
- How do I create a drop down menu in a widget?
- Add/echo div with Analytics-Code to function in functions.php
- How to allow PHP In WordPress text widget
- How do I hardcode a WordPress shortcode into my theme?
- How to return multiples lines in a shortcode?
- Show Specific Footer Widget for Specific Pages
- Class ‘WP_Widget’ not found
- nowplaying.include.php Will Not Display Results
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- How do I turn a shortcode into PHP code?
- How to return a foreach inside a shortcode
- I can’t get my custom widget area to show on my WordPress site
- How to run PHP code in Text Widget with no plugin in WP 4.4
- WordPress widget/sidebar dividers?
- custom shortcode will not display the wrapped content
- Shortcode content output but not in correct place
- PHP code inside shortcodes
- Trigger popup in a php if/else statement
- Append HTML Using Shortcode
- How to output widget
- How to output a PHP file values by shortcode?
- Extending the WP_Widget_Text class
- How to make my custom widget appear within WordPress widgets? Plugin development
- get widget number from array dynamically
- Adding widgets to my plugin page instead of WordPress dashboard
- Pass php dynamic variable to shortcode
- do_shortcode with custom field
- Remove echo from shortcode
- If has $title in widgets
- Shortcode to show the code
- Get URL from shortcode tag
- Show latest posts in a plain HTML website custom widget [closed]
- Multiple do_shortcode in page template
- Is it bad to add html to a widget by closing and reopening the php tags?
- $wpdb returns duplicate posts
- Shortcode to find and replace URL
- Could use some help with Shortcodes
- How to put a form with php code into a variable or shortcode?
- Shortcode to embed Edit Account form not working
- Widgets not showing on custom theme
- My website is not showing Footer section
- Handling PHP/HTML inside the output of a shortcode function
- Need to Modify a WordPress Shortcode with another wordpress shortcode
- Split shortcodes to array of shortcodes
- Shortcodes showing in excerpt despite using strip_shortcodes
- PHP error with a shortcode: “no suitable wrapper” for file_get_contents
- How to make a conditional statement within $output in shortcodes.php?
- How to use title attributes in sidebar widget?
- display specific widget to a page
- Dynamically display font icons in widget
- How to get my [shortcode] rendered on the home page, other pages are fine
- Correct code to use php in text widget
- Shortcode displaying at the top of the page [duplicate]
- Stuck with sidebar registering
- Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
- MySQL Query Returns Array () In Shortcode
- Why wp_remote_get() fetches certain web pages while it doesn’t work for my localhost?
- How to exclude labels from certain categories in a shortcode?
- Trying to call dynamic content into a 3rd party shortcode
- Shortcode in Shortcode/HTML Graphics and Pictures
- Why is the current page loaded in the pop-up window and not the specified one?
- How to search order using database frontend short code WordPress
- How to add a shortcode which runs a .php file for the current post
- Block error message in foreach loop when looping through ACF field
- Loading Widgets Via Child Theme
- Get title of page containing post grid within the posts
- PHP multiple forms, same page, isset($_POST[]) not working?
- shortcodes, custom php and their errors
- Echo short code syntax
- Changing Date Format on Custom Meta Data w/shortcode call
- Why my Ajax events are no longer detected after dynamic change of shortcode content
- Offset with ajax load more posts duplicates
- Get posts by id using shortcode
- How can i iterate through this shortcode array?
- Beyond widget side menu editing, with the php page, custom template
- PHP: Why does my code work in index.php but not a widget?
- Shortcode is not outputting all of the desired markup
- Run PHP Results inside WP Shortcode
- Serializing URL via wp add_shortcode to auto select from option list onload
- WordPress – registering sidebar and adding a button directly after .textwidget
- On selecting shortcode generate selected shortcode table inside page editor worrdpress
- Show contact 7 form in popup
- My custom widget won’t stay in the widget area after I refresh the widget page
- Custom field within shortcode
- How to change links in the 3 main categories, on widget category, to a javascript function call
- My title is showing after the shortcode
- Shortcode to include PHP file, pass various parameters to include?
- HTTP 500 Error after Creating Shortcode
- How to execute a shortcode within a custom field?