在colorbox iframe中加载wordpress页面内容 [英] Loading wordpress page content in colorbox Iframe

查看:122
本文介绍了在colorbox iframe中加载wordpress页面内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用colorbox插件构建一个Wordpress网站。
我正在使用在iframe中打开网页的文字链接。这很好。

I'm building a Wordpress site using the colorbox plugin. I'm using text-links which open a webpage in an Iframe. That works fine.

但现在,我想在其中加载某个wordpress页面的内容,特别是使用Nimble组合插件创建的Item组合页面。

But now, I want to load the content of a certain wordpress page in it, particular an Item portfolio page created with the Nimble portfolio plugin.

我想我必须使用一些基本代码,例如

I think I have to use some basic code like

<a href="<?php echo get_page(36)->post_content; ?>" class="colorbox-link">Contact</a>

但我无法修复它。

有任何建议吗?

推荐答案

感谢您对我关于stackoverflow的第一个问题的同情评论。
我很抱歉,如果我的问题不够明确,但问题所在的网站仍处于开发阶段。

Thanks for your sympathizing comments on my first question on stackoverflow. I'm sorry if my question wasn't clear enough, but the site where the problem shows up is still in development.

但幸运的是我已经经过很长一段时间后想出来了:

But fortunately I've figured it out after a long time:

在single.php旁边我创建了一个singe-portfolio.php文件,因为Wordpress的高层次,WordPress终于找到了singe - {filetype} .php。

Next to single.php I created a singe-portfolio.php file, because because of the Wordpress hiërarchy, WordPress finally looks for singe-{filetype}.php.

在Nimble Portfolio循环中,我使用以下代码链接到此文件:

In the Nimble Portfolio Loop, I linked to this file with the following code:

<a href="<?php echo 'http://siteurl/?p='.$post_id; ?>" class="button-fixed colorbox-link">...</a>

在single-portfolio.php文件中,我使用常规的WordPress循环来获取页面内容JQuery Colorbox iframe。

In the single-portfolio.php file, I used a regular WordPress loop to get the page content in the JQuery Colorbox Iframe.

希望这会帮助别人!

这篇关于在colorbox iframe中加载wordpress页面内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆