That should work. Check the HTML that is being produced in the page.
Thread Starter
lumor
(@lumor)
Hi Micheal,
when I use the code above, I get no results, i returns now number and i have checked the html but nothing shows up there either.
If you go to the CFDB Shortcode page, build the shortcode, and click on it to see the results, do you get anything?
Thread Starter
lumor
(@lumor)
Thanks for getting back to me.
When i build the shortcode or copy and paste it in the text box of visual composer and then preview, i get the the number of entries.
But then when i run it in within the JS code, it doesn’t return any number, no feedback at all
What exactly does the script tag look like in your post?
What exactly does the script tag look like when you view the page source in the browser after viewing the resulting post?
Thread Starter
lumor
(@lumor)
It looks like this in my post (using text box of visual composer);
<script type="text/javascript">// <![CDATA[
var value = [cfdb-count form="Petition1(Our Problem)" role="Anyone" permissionmsg="true"] + 1000;
document.write(value);
// ]]></script>
and looks like this when i view page source ;
<div class="wpb_text_column wpb_content_element ">
<div class="wpb_wrapper">
<p><script type="text/javascript">// <![CDATA[
var value = [cfdb-count form="Petition1(Our Problem)" role="Anyone" permissionmsg="true"] + 1000;
document.write(value);
// ]]></script></p>
</div>
</div>
Thread Starter
lumor
(@lumor)
sorry, it rather looks like this when i view page source
<div class=”wpb_text_column wpb_content_element “>
<div class=”wpb_wrapper”>
<p><script type=”text/javascript”>// <![CDATA[
var value = [cfdb-count form=”Petition1(Our Problem)” role=”Anyone” permissionmsg=”true”] + 1000;
document.write(value);
// ]]></script></p>
</div>
</div>
Thread Starter
lumor
(@lumor)
I first suggest removing
// <![CDATA[
and its closing
// ]]
The WP editor seems to be replacing the open and close brackets [] around the shortcode with their HTML character codes. Consequently WP does not see [] and does not recognize this as a shortcode and nothing happens.
You might try deleting the [] character in WP Editor Text mode and typing them in again.