Skip to main content
added 11 characters in body
Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

Your syntax is broken, the quote marks do not match. Try to separate data from the shortcode template, and use sprintf():

$shortcode = sprintf(
    '[pw_map address="%1$s %2$s %3$s %4$s" width="100%"width="%5$s" height="200px"]',
    $address,
    $city,
    $province,
    $postalcode,
    '100%'
);
echo do_shortcode( $shortcode );

That’s much easier to read, and it is harder to create syntax errors. :)

Your syntax is broken, the quote marks do not match. Try to separate data from the shortcode template, and use sprintf():

$shortcode = sprintf(
    '[pw_map address="%1$s %2$s %3$s %4$s" width="100%" height="200px"]',
    $address,
    $city,
    $province,
    $postalcode
);
echo do_shortcode( $shortcode );

That’s much easier to read, and it is harder to create syntax errors. :)

Your syntax is broken, the quote marks do not match. Try to separate data from the shortcode template, and use sprintf():

$shortcode = sprintf(
    '[pw_map address="%1$s %2$s %3$s %4$s" width="%5$s" height="200px"]',
    $address,
    $city,
    $province,
    $postalcode,
    '100%'
);
echo do_shortcode( $shortcode );

That’s much easier to read, and it is harder to create syntax errors. :)

Source Link
fuxia
  • 107.1k
  • 38
  • 255
  • 459

Your syntax is broken, the quote marks do not match. Try to separate data from the shortcode template, and use sprintf():

$shortcode = sprintf(
    '[pw_map address="%1$s %2$s %3$s %4$s" width="100%" height="200px"]',
    $address,
    $city,
    $province,
    $postalcode
);
echo do_shortcode( $shortcode );

That’s much easier to read, and it is harder to create syntax errors. :)