Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在WordPress中将单个帖子链接到thickbox?_Php_Wordpress_Wordpress Theming_Thickbox - Fatal编程技术网

Php 如何在WordPress中将单个帖子链接到thickbox?

Php 如何在WordPress中将单个帖子链接到thickbox?,php,wordpress,wordpress-theming,thickbox,Php,Wordpress,Wordpress Theming,Thickbox,如何将single.php链接到thickbox中打开 我知道我必须将class=“thickbox”添加到永久链接中,但如何将帖子内容与之链接 我尝试创建一个隐藏的div,其中包含我希望弹出窗口显示的内容,然后链接到div ID,但我没有仔细考虑,因为这个方法显示的是thickbox中整个页面的克隆。不是我想要的 但是如果你只是把class=“thickbox”添加到permalink中,它应该会把你带到一篇文章中,你只会得到一个空的thickbox 关于如何在thickbox中显示更详细的帖

如何将single.php链接到thickbox中打开

我知道我必须将
class=“thickbox”
添加到永久链接中,但如何将帖子内容与之链接

我尝试创建一个隐藏的
div
,其中包含我希望弹出窗口显示的内容,然后链接到div ID,但我没有仔细考虑,因为这个方法显示的是thickbox中整个页面的克隆。不是我想要的

但是如果你只是把
class=“thickbox”
添加到permalink中,它应该会把你带到一篇文章中,你只会得到一个空的thickbox


关于如何在thickbox中显示更详细的帖子内容,有什么建议吗?非常感谢您的帮助。

我找到了一个解决方案,可以在fancybox弹出窗口中显示single.php的内容

我从single.php中删除了
get_header
get_footer
,但包括了
wp_head
wp_footer
,以便加载样式表和脚本

然后我下载了用于WordPress的Easy Fancybox并启用了Iframe内容

fancybox中打开的我的单篇文章的链接如下所示:

以防万一有人想达到同样的目的