Loading wordpress page content in colorbox Iframe

≡放荡痞女 提交于 2019-12-24 19:58:34

问题


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.

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>

but I can't fix it.

Any suggestions?


回答1:


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:

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.

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>

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

Hope this will help someone else!



来源:https://stackoverflow.com/questions/17276443/loading-wordpress-page-content-in-colorbox-iframe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!