How to support extra color options for shortcodes?

You have multiple options. A) Use inline-CSS: <button style=”background: <?php echo CHOSEN_COLOR_HERE (possibly validated) ?>;”> … </button> B) Write (ID-specific) CSS styles into your page. In your shortcode function, echo a <style> tag, for instance like so: <style> #shortcode-button-1 { background: <?php echo CHOSEN_COLOR_HERE (possibly validated) ?>; } #shortcode-button-2 { background: <?php echo CHOSEN_COLOR_HERE (possibly … Read more

Modify function Shortcode_atts

You are misusing shortcode_atts(). You need to pass the shortcode an array of defaults in the first argument, which you have done. Then you need to pass the user supplied arguments in the second argument, which you haven’t done. Your shortcode callback uses $params yet for some reason you are passing $atts, which is not … Read more

Problem with shortcodes in external file

Shortcodes and Tags At first, please keep in mind that your understanding of tags is actually a shortcode. A Tag is used to add meta information to content, while a shortcode is used for adding functionality, usually to be called from inside the content. To your Problem As @s_ha_dum pointed out, you should implement your … Read more

Video shortcode inside tabs shorcode NOT working

Make sure to wrap content with do_shortcode() I’m not sure what the exact function looks like, but for simplicity sake take a look at this example: //[tab]Content[/tab] function tab_func($atts, $content = null) { extract( shortcode_atts( array( ), $atts ) ); $output=”<div class=”tab”>”.do_shortcode($content).'</div>’; return $output; } add_shortcode( ‘tab’, ‘tab_func’ ); If you take a look at … Read more

Show contact 7 form in popup

So far I guess, you need the following corrections: <div class=”map”> <img src=”http://www.gate7infotech.com/projects/development/MyLuckyBottle/wp-content/themes/twentythirteen/images/home_background.jpg”/> <a href=”#pop-up-form” shape=”rect” coords=”31,572,499,1028″ class=”a lightbox”>Registration Form</a> <a href=”#” class=”b”></a> <a href=”#” class=”c”></a> </div> <?php //This should be a hidden DIV; ?> <div id=”pop-up-form” style=”display:none”><?php echo do_shortcode(“[contact-form-7 id=’4′ title=”Registration Form”]”); ?></div>