I've requirement to use multiple values for Shortcode.
Currently I'm adding 2 separate shortcodes for the same
e.g.
[wpcode id="2658"]
[wpdiscuz_comments]
Is there a way to use single Shortcode and add multiple values ?
I've requirement to use multiple values for Shortcode.
Currently I'm adding 2 separate shortcodes for the same
e.g.
[wpcode id="2658"]
[wpdiscuz_comments]
Is there a way to use single Shortcode and add multiple values ?
You can combine these two shortcodes into one by using a custom shortcode that includes both of them:
function custom_shortcode() {
$output = '';
// Get the wpcode shortcode output
$wpcode_output = do_shortcode('[wpcode id="2658"]');
// Get the wpdiscuz_comments shortcode output
$wpdiscuz_output = do_shortcode('[wpdiscuz_comments]');
// Combine the two outputs into a single output
$output .= $wpcode_output . $wpdiscuz_output;
// Return the combined output
return $output;
}
add_shortcode('custom_shortcode', 'custom_shortcode');
Please note: The way to pass values to a shortcode can vary depending on the specific shortcode and the plugin or theme that provides it.