drn1008 2017-04-18 15:22
浏览 113

将url参数传递给短代码

Background of my question: I created over 300 slideshows. In my WordPress page/post they are activated with a shortcode i.e [masterslider id=15]. I pass the value (id=15) as an url-parameter to my custom-template. i.e //url?nmbr=15. That works. I can echo the value, I can echo the complete shortcode [masterslider id="15"] but the slider doesn't start to show pictures.

of course, I can create one page with 100 shortcodes wich will make the page very slow. I can create 100 pages with one slider but I don't like that.

Some of the fifty different codelines I tried in my own-template.php is: ` '

I also tried ob_start with ob_clean without succes. Please help.

  • 写回答

1条回答 默认 最新

  • du7535 2017-04-19 20:20
    关注

    I suspect the moment you apply your short-code value , content for the page is already loaded. So it never gets executed.

    So I would try adding the_content filter to add/edit the short-code's ID so it gets changed before content gets displayed.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?