WordPress 隐藏页面内容
我正在使用 WP-Ecommerce 创建一个 WordPress 网站。我的客户要求提供一个我不知道如何制作的功能。他有一个带有很长描述的产品,并且他想要多个“继续阅读”链接来隐藏其中的部分内容。它应该在 javascript 中完成,以便客户端在单击“阅读更多”时不会被重定向到任何地方(扩展内容应该滚动打开。)
找到一个插件会很好,但我似乎找不到一个。
Im creating a wordpress site with WP-Ecommerce. My client asked for a functionality that i cant figure out how to make. He has a product with a long description and he wants multiple "read on" links to hide parts of it. It should be done in javascript so that client wont be redirected anywhere when he clicks on read more (extended content should just scroll open.)
it would be nice to find a plugin but i cant seem to find one.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为此编写一个插件很容易。您只需要编写一个短代码来添加 javascript 即可执行您想要的操作。例如 jQuery 手风琴。
类似的东西可以添加到你的functions.php中,你可以将折叠所需的所有内容包装在[accordion][/accordion]标签中...并且它将在标签处分解这些部分...
A plugin for this would be easy to write. You just need to write a shortcode that adds the javascript to do what you want. The jQuery accordion for instance.
Something like that can be added to your functions.php and you would wrap everything you need to collapse in [accordion][/accordion] tags... and it will break the sections down at the tags...
不知怎的,我无法让 Accordion() 函数正常工作,但 Steve 给我指出了正确的方向,我得到了这个:
以及我需要隐藏在阅读更多链接下的东西,我包裹在 [accordion][/accordion] 标签中
somhow i couldn't get accordion() function to work but Steve pointed me in right direction and i got this going:
and things i needed to hide under read more link i wrapped in [accordion][/accordion]tags