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

我该如何链接single.php在Thickbox中打开?

我知道我必须在永久链接中添加class =” thickbox”-但是我该如何链接帖子内容?

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

但是, 如果你仅将class =” thickbox”添加到固定链接, 该链接将使你进入单个帖子, 则只会得到一个空的thickbox。

关于如何在thickbox中显示更详细的帖子内容有任何建议吗?帮助将不胜感激。


#1


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

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

然后, 我下载了适用于WordPress的Easy Fancybox并启用了iframe内容。

现在, 指向我在fancybox中打开的单个帖子的链接如下所示:

<a class=”fancybox-iframe” href=”<?php the_permalink(); ?>”>在弹出窗口中打开单个帖子</a>

以防万一有人试图实现同一目标。

来源:

https://www.srcmini02.com/67025.html

微信公众号
手机浏览(小程序)

Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(): Failed to enable crypto in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57

Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_36981.jpg): failed to open stream: operation failed in /mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line 57
0
分享到:
没有账号? 忘记密码?