2017-06-09 162 views
1

我想显示一些WP内容,但只显示静态文本。没有WP内容出现。 它看起来似乎没有WP脚本正在加载查看开发工具源代码?WordPress iframe内容现在显示

对我所错过的任何帮助都非常感谢。

这里是page.php文件内我的电话:

<iframe src="http://www.xxxxxx.com/wp-content/themes/themename/iframe-gview.php" width="100%" height="500" frameBorder="0"></iframe> 

我的PHP模板代码:

<!DOCTYPE html> 
<html> 
<head> 
<meta charset="utf-8"> 
<title>Applications</title> 
<?php wp_head(); ?> 
</head> 
<body> 
<link rel="stylesheet" type="text/css" href="http://www.xxxxxx.com/wp-content/themes/themename/assets/css/style.css"> 

    Static Content 

    <?php 
     echo do_shortcode('[gravityview id="1234"]'); 
    ?> 

<?php wp_footer(); ?> 
</body> 
</html> 
+0

什么iframe中的错误? – vel

+0

上面更新了我的解释@vel –

+0

您是否从任何其他站点访问此URL'http:// www.xxxxxx.com/wp-content/themes/themename/iframe-gview.php' – vel

回答

0

如@vel如上所述,这解决了我的问题:

<?php require_once('../../../wp-load.php'); ?>