drq9991 2014-08-14 16:37
浏览 26
已采纳

在PHP中使用Shortcodes

Im trying to insert the shortcodes [acf field="my_map"] and [acf field="links"] in place of the the_field('my_map') and the_field ('links') located in the $html string shown in the code below. I'm apparently not PHP savvy enough to make it work. Help please?

<?php
if ( function_exists( 'wpmudev_ppw_html' ) ) {
$html = '<div class="row top-spacer"><div class="col-md-8"><img class="img-responsive img-thumbnail" src="'.the_field('macro_map').'" /></div><div class="col-md-4"><h5><?php the_title(); ?>Resource Links</h5>'.the_field('symbol_news_links').'</div></div>'; // html code to be protected (required)
$id = 1; // An optional unique id if you are using the function more than once on a single page
$description = 'video'; // Optional description of the protected content
$price = '1.50'; // Optional price for a single view. If not set, price set in the post will be applied. If that is not set either, Unit Price in the Global Settings will be used.
echo wpmudev_ppw_html( $html, $id, $description, $price );
}
?>
  • 写回答

1条回答 默认 最新

  • duanpiyao2734 2014-08-14 17:37
    关注

    Replace <?php the_title(); ?> with '.the_title().'

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应
  • ¥15 matlab基于pde算法图像修复,为什么只能对示例图像有效