Wordpress帖子没有显示在网站的外部页面上

时间:2014-04-06 16:51:07

标签: php wordpress iframe

我正在网站上工作......除此之外..我想将一个页面设为Iframe,并希望在该页面中显示一个wordpress帖子..

问题是它没有显示任何内容......当代码被执行时......你能不能看看它出了什么问题?

以下是该页面的链接:http://www.webngraphicssolutions.com/universal/wp-content/themes/universal/content/register.php

这是我的Iframe页面代码:

<?php 
require('http://www.webngraphicssolutions.com/universal/wp-blog-header.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Register Page</title>
<link href="reset.css" rel="stylesheet" type="text/css">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="jquery.sb.css" rel="stylesheet" type="text/css">
<style type="text/css">.dpmaxz_hidden {visibility: hidden;}#dpmaxz_root {-webkit-user-select: none; display: inline-block; z-index: 2147483647;margin: 0;padding: 0;}#dpmaxz_gui {-webkit-user-select: none; position: static; margin: 0;padding: 0;cursor: default;}#dpmaxz_root .dpmaxz_mainbkg {display: block;position: absolute;cursor: default;margin: -25px 0 0 -32px;width: 50px;height: 24px;background: transparent url(chrome-extension://ncffjdbbodifgldkcbhmiiljfcnbgjab/) no-repeat;}#dpmaxz_root .dpmaxz_mainbkg .dpmaxz_fbishield {float: left;margin: -10px 0 0 3px;padding: 0;width: 29px;height: 37px;background: transparent url(chrome-extension://ncffjdbbodifgldkcbhmiiljfcnbgjab/images/mainimg.png) no-repeat;}#dpmaxz_root .dpmaxz_mainbkg .dpmaxz_fbiauthok {background: transparent url(chrome-extension://ncffjdbbodifgldkcbhmiiljfcnbgjab/images/mainimg_ok.png) no-repeat;}#dpmaxz_root .dpmaxz_mainbkg .dpmaxz_fbiauthno {background: transparent url(chrome-extension://ncffjdbbodifgldkcbhmiiljfcnbgjab/images/mainimg_no.png) no-repeat;}#dpmaxz_root .dpmaxz_mainbkg .dpmaxz_fbixchg {background: transparent url(chrome-extension://ncffjdbbodifgldkcbhmiiljfcnbgjab/images/mainxchg.png) no-repeat;}#dpmaxz_root .dpmaxz_mainbkg .dpmaxz_menuact {background: transparent url(chrome-extension://ncffjdbbodifgldkcbhmiiljfcnbgjab/images/mainmact.png) no-repeat;}#dpmaxz_root .dpmaxz_mainbkg .dpmaxz_fbiadd {height: 16px;width: 15px;float: right;background: transparent url(chrome-extension://ncffjdbbodifgldkcbhmiiljfcnbgjab/images/mainadd.png) no-repeat;margin: 0 -16px 0 0;}#dpmaxz_gui .dpmaxz_menus {position: absolute; z-index: 2147483647; }.dpmaxz_menusrel {position: relative; }#dpmaxz_gui .dpmaxz_menus ul {position: absolute; left: 0;top: 22px; list-style: none;white-space: nowrap;border: 1px solid #a0a0a0;background-image: -webkit-linear-gradient(top, rgb(240,245,255) 73%, white 100%);box-shadow: 4px 4px 4px -3px #605F70;font-family: 'Segoe UI',Verdana,Arial;font-style: normal;font-size: 1em;padding: 3px 3px;margin: 2px 4px 2px 4px;}#dpmaxz_gui .dpmaxz_menus ul li {text-decoration: none;text-align: left;margin: 0; padding: 0;}#dpmaxz_gui .dpmaxz_menus ul li:hover {border: 1px solid #aecff7;-webkit-border-radius: 4px;background-color: #edf1f6;margin: -1px;}#dpmaxz_gui .dpmaxz_menus .dpmaxz_menurow {position: relative;color: black;height: 22px;float: none; }#dpmaxz_gui .dpmaxz_menus .dpmaxz_menurow span {display: inline-block !important;  }#dpmaxz_gui .dpmaxz_menus .dpmaxz_menurowicon {display: inline-block;width: 26px;height: 22px;position: relative;vertical-align: top;border-right: 1px solid #e2e3e3;font-size: 12px; color: black; }#dpmaxz_gui .dpmaxz_menus .dpmaxz_menurowtext {display: inline-block;border-left: 1px solid #ffffff;padding: 0 4px;font: normal 1em 'Segoe UI',Verdana,Arial; font-size: 12px;height: 22px;vertical-align: middle;}.dpmaxz_highlight {-webkit-border-image: url(chrome-extension://ncffjdbbodifgldkcbhmiiljfcnbgjab/images/highlighter.png) 5 9 8 6 repeat;border-image: url(chrome-extension://ncffjdbbodifgldkcbhmiiljfcnbgjab/images/highlighter.png) 5 9 8 6 repeat;}</style>

<script language="JavaScript" src="scripts/gen_validatorv31.js" type="text/javascript"></script>
</head>

<?php   $recent = new WP_Query("page_id=116"); while($recent->have_posts()) : $recent->the_post();
the_content();
endwhile;   ?> 

</body></html>

1 个答案:

答案 0 :(得分:0)

尝试

$parse_uri = explode('wp-content', $_SERVER['SCRIPT_FILENAME']);
$wp_load = $parse_uri[0] . 'wp-blog-header.php';
require( $wp_load );