dongzhong5756 2014-04-06 16:51
浏览 50
已采纳

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

I am just working on a website...Besides..I want to put a page as Iframe and want to show the a wordpress post in that page..

the problem is that it is not showing anything...when the code get executed..can you please look at it that what is going wrong?

Here is link to the page as: http://www.webngraphicssolutions.com/universal/wp-content/themes/universal/content/register.php

here is My Iframe page code :

<?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条回答 默认 最新

  • dongxing6802 2014-04-06 22:36
    关注

    Try

    $parse_uri = explode('wp-content', $_SERVER['SCRIPT_FILENAME']);
    $wp_load = $parse_uri[0] . 'wp-blog-header.php';
    require( $wp_load );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥200 uniapp长期运行卡死问题解决
  • ¥15 latex怎么处理论文引理引用参考文献
  • ¥15 请教:如何用postman调用本地虚拟机区块链接上的合约?
  • ¥15 为什么使用javacv转封装rtsp为rtmp时出现如下问题:[h264 @ 000000004faf7500]no frame?