Hi Charudatta,
Thanks for using Shortcoder.
With shortcoder plugin we cannot achieve “dynamic” conditions.
Shortcoder is meant to create small shortcodes for big HTML/CS/JS snippets.
Adding conditions is basically creating a programming language.
I would suggest create your own shortcode and call shortcoder shortcodes like below.
/* Create a shortcode which will conditional print shortcoder shortcode */
function sc_condition_function($args){
$category = get_the_category();
$firstCategory = $category[0]->cat_name;
if( $firstCategory = 'my_category' ){
echo do_shortcode( '[sc name="sc1"]' );
}else{
echo do_shortcode( '[sc name="sc2"] );
}
}
add_shortcode('sc_condition', 'sc_condition_function');
Thanks,
Aakash