Tracking the number of shortcodes for a list?

Wrap an <ol> around them and have your [resource] shortcode create an <li> for each one. Editor view: <ol> [resource name=”Resource” link=”http://foo.com”]Why I love it[/resource] [resource name=”Another Resource” link=”http://footwo.com”]Why I love this[/resource] </ol> HTML output: <ol> <li><a href=”http://foo.com”>Resource</a><p>Why I love it</p></li> <li><a href=”http://footwo.com”>Another Resource</a><p>Why I love this</p></li> </ol>

Use Contact Form 7 with Ajax

It is hard to give a 100% answer without seeing the code of how the shortcode is being registered, but from your description it sounds like it is not being registered when ajax requests are being processed. The reason is probably because ajax requests are being handled in an “admin” conttext, and shortcodes are a … Read more

Do shortcode in template file

I think you need to escape the quotes: <?php echo do_shortcode(‘[gfchartsreports include=”28″ type=”bar” chart_js_options=”title: {display: true, text: \’Titletext\’, fontSize:12,fontFamily:\’Arial\’,fontColor:”#000″,fontStyle:”bold”,padding:20}” custom_search_criteria=\'{“status”:”active”,”field_filters”:{“0”:{“key”:”created_by”,”value”:”current”}}}\’]’); ?>

How to use a nested shortcode to render the value of an attribute in parent shortcode

I decided to modify the custom shortcode to make it a wrapper for the parent shortcode. Instead of returning a value, it now returns a call (using do_shortcode()) to the parent with its “to” attribute dynamically set. OLD VERSION … $val = get_some_value(); return $val; NEW VERSION … $val = get_some_value(); return do_shortcode(“[ut_count_up to=\”$val\”]”);

How to create shortcode with html and php content?

To create a shortcode from your functions, you need to use the following code: function my_shortcode_function(){ if (get_option(‘pixieclash-standings-background’) && get_option(‘pixieclash-standings-background’) != null) { $background = esc_url(get_option(‘pixieclash-standings-background’)) } else { $background = get_stylesheet_directory_uri() . ‘/images/standings-bg.jpg’; } $headTxt = get_option(‘pixieclash-standings-section-heading-top’); $bottomText = get_option(‘pixieclash-standings-section-heading-bottom’); if(!empty($headTxt)){ $text_header=”<h4>”. esc_attr($headTxt);.'</h4>’; } else { $text_header=””; } if(!empty($bottomText)) { $text_footer=”<h3>”.esc_attr($bottomText); .'</h3>’; } else … Read more

shortcode tags not working in do_shortcode

You maybe need to return the output at the end of the function, then do’t forget to echo the do_shortcode(). function shortcodename_function($atts) { $pairs = array( ‘title’ => ‘bananas’ ); $a = shortcode_atts($pairs, $atts); return $a[‘title’]; } echo do_shortcode(‘[shortcodename title=”monkeys”]’); Of course you can echo directly in the function, but it’s a bad pratice for … Read more

how can I change my font color for Shortcode [closed]

Contact form 7 uses the wpcf7-form class for it’s forms and wpcf7 for it’s parent DIV. You can set the color of the input types by these CSS rules: .wpcf7-form input[type=”text”], .wpcf7-form input[type=”url”], .wpcf7-form input[type=”password”], .wpcf7-form input[type=”email”], .wpcf7-form textarea { color:white !important } The !important rule will make it override any other style’s rules. Head … Read more