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?
- How to include checkbox in widget backend form?
- How to manually fix the WordPress gallery code using PHP in functions.php?
- Return HTML Template Page with PHP Function
- Limit the number of inactive widgets
- Encode text string being appended as query to URL [closed]
- How do I use Shortcodes inside of HTML tags?
- Is there a way to parse shortcodes in PHP?
- How display widget by id
- Shortcode to insert
- Shortcode putting html such as
- Create Image Uploader for Widget
- Display sorting options dropdown when using WooCommerce product category shortcode
- Retrieve multiple values passed to a single attribute in a shortcode
- How to get the registered sidebar’s name by its id?
- WordPress Shortcode and Dynamic CSS
- Displaying a variable stored in functions.php inside widget
- ob_get_clean returns empty string, ob_get_flush outputs string
- Display a text message if the shortcode is not found?
- Check if widget has content
- Export User Info to CSV from Front End
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Transform php code into a widget?
- Shortcode created to check language not works
- How do I create a drop down menu in a widget?
- WordPress widget in custom theme
- How to return a string that has a variable inside in a shortcode?
- Run shortcode at certain resolution
- Using Echo in ShortCode – Stuck
- Passing a shortcode attribute to a sub-function
- How to create shortcodes that pull custom field data from general settings
- post meta value as shortcode parameter
- How to protect own PHP code from WordPress updates
- Add/echo div with Analytics-Code to function in functions.php
- How to allow PHP In WordPress text widget
- Creating a WordPress shortcode
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Multiple do_shortcode($content) within one shortcode
- Adding Image Count to Multigallery
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- display most popular tags in two columns
- List authors with posts in a category
- Get list of shortcodes from content
- Audio tags around Mp3 URL in content
- How do I hardcode a WordPress shortcode into my theme?
- Loading page template into shortcode
- My shortcode is showing up twice
- has_shortcode() – how to detect nested shortcode
- How to return multiples lines in a shortcode?
- Anything I can add to functions.php to make text widgets accept PHP?
- Custom plugin issue when trying to use the shortcode twice on a page [closed]
- How can I default to all WordPress roles when parameter is not included in shortcode?
- Show Specific Footer Widget for Specific Pages
- dynamic sidebar not showing anything
- How can I add a specific, custom widget to my theme’s header.php?
- Get widget settings function?
- Widgets not showing in my custom theme
- How to find the output of contact form 7 shortcode? [closed]
- Class ‘WP_Widget’ not found
- Wrap each shortcode in array to div
- How do i get (unique) page name?
- nowplaying.include.php Will Not Display Results
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- Can A Shortcode Get HTML/Text From Content And Return It Twice With Added HTML?
- Recent post display using shortcode
- javaScript in section of WP API
- Browser title script ignoring is_page /else conditional [closed]
- How do I turn a shortcode into PHP code?
- Style every second widget?
- Nested shortCode functions in the functions.php file
- Placing the_content inside shortcode not working
- Put php variable in shortcode
- get_page_by_title with an apostrophe in variable
- How to group 2 radio buttons in a widget?
- Need to turn this php into WP shortcode
- Add before_content and after_content to register_sidebar
- Making Quote Plugin more efficient
- Autogenerate shortcodes from an array of strings
- How to limit the content coming from wordpress shortcodes?
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- 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
- Placing raw HTML inside a WordPress shortcode
- How do I add text in a shortcode?
- WordPress widget/sidebar dividers?
- How to Insert Shortcodes into Theme?
- How can I get content inside one shortcode to another shortcode?
- Template part inside shortcode, unexpected reult
- Shortcode Inside Class Not Working
- custom shortcode will not display the wrapped content
- Shortcode content output but not in correct place
- is_page “range” for if statement?
- How can I generate random numbers inside my shortcodes on each implementation?
- custom widget on the footer
- PHP code inside shortcodes