I have a fairly complicated shortcode that works well when put inside the wysiwyg editor. Now I try to include this in a template php-file using do_shortcode but it doesn’t work.

My used but not working code is:

<?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"}}}']'); ?>

I’m not a php pro and so I guess the error will be a beginner’s mistake. Could anyone help me out with his coding wisdom?

Thank’s a lot for your help!

Read more here: Do shortcode in template file


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: