admin管理员组文章数量:1410712
Hi i am trying to build a simple wordpress template template and want to introduce a pdf viewer into the page that pull's it file from an ACF field I am pulling my hair out with the syntax on the following do_shortcode call
PHP
<?php echo do_shortcode("[tnc-pdf-viewer-iframe file=".get_field('document_link')." width="900px" height="700px" download="false" print="false" fullscreen="true" share="true" zoom="true" open="true" pagenav="true" logo="true" find="true" current_view="true" rotate="true" handtool="true" doc_prop="true" toggle_menu="true" toggle_left="true" scroll="true" spread="true" language="en-US" page="" default_zoom="" pagemode=“”]");?php>
Hi i am trying to build a simple wordpress template template and want to introduce a pdf viewer into the page that pull's it file from an ACF field I am pulling my hair out with the syntax on the following do_shortcode call
PHP
<?php echo do_shortcode("[tnc-pdf-viewer-iframe file=".get_field('document_link')." width="900px" height="700px" download="false" print="false" fullscreen="true" share="true" zoom="true" open="true" pagenav="true" logo="true" find="true" current_view="true" rotate="true" handtool="true" doc_prop="true" toggle_menu="true" toggle_left="true" scroll="true" spread="true" language="en-US" page="" default_zoom="" pagemode=“”]");?php>
Share
Improve this question
asked Jan 13, 2020 at 18:27
Just StuckJust Stuck
1
1 Answer
Reset to default 0Even though you are echoing the shortcode, I think you still need to echo the ACF field inside the string of the do_shortcode function. Change your ACF field return function for the_field() :
<?php echo do_shortcode("[tnc-pdf-viewer-iframe file=".the_field('document_link')." width="900px" height="700px" download="false" print="false" fullscreen="true" share="true" zoom="true" open="true" pagenav="true" logo="true" find="true" current_view="true" rotate="true" handtool="true" doc_prop="true" toggle_menu="true" toggle_left="true" scroll="true" spread="true" language="en-US" page="" default_zoom="" pagemode=“”]");?php>
本文标签: shortcodeAdvanced Custom Forms PHP formatting for doshortcode
版权声明:本文标题:shortcode - Advanced Custom Forms PHP formatting for do_shortcode 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744839205a2627817.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论