在使用WordPress里在一个页面里我使用the_content()方法来输出当前页面的内容,但却显示为空,而标题,url等都没有问题

在网络上好像遇到这种情况的人很少只找到了一个说是可能是function里有函数覆盖了the_content方法
但我将function方法删除掉还是不行,然后我将代码全部删除掉只留这一句"<?php the_content()?>"
结果还是不行,无奈只能通过其他方式解决
解决方案:
使用$post对像里的属性“ <?php echo $post->post_content;?>”
 
下面是我的page.php里的所有内容
<?php
/** 内页/单页面
* @author htl
* @date 2014-01-28
*/
get_header();
?>
<?php get_sidebar()?>
<div id="neirong">
<?php if ( have_posts() ) :?>
<h1><?php the_title();?></h1>
<div id="content">
<?php
the_content()方法无法输出文章内容,通过$post对象里的post_content属性来输出
//the_content();
//print_r($post);
echo $post->post_content;?>
</div>
<?php else : ?>
<?php get_template_part( '404'); ?>
<?php endif; ?>
</div>
<!-- neirong end -->
<?php get_footer(); ?>

最新文章

  1. 第一章 Java多线程技能
  2. shell test用法
  3. cocoapods无法使用(mac os 10.11升级导致pod: command not found)
  4. MVC 知识点学习3(linq to sql)
  5. thinkphp 创建子应用
  6. Java多线程编程核心技术---对象及变量的并发访问(二)
  7. nginx 反向代理 google
  8. C++字符串(String)
  9. 《View Programming Guide for iOS》之frame、bounds和center之间的关系
  10. 黄聪:WebBrowser执行和安装jQuery脚本(IEBrowse)
  11. codeforces 651A Joysticks
  12. TIMAC 学习笔记(三)
  13. qut训练题解-2016-9-4个人赛
  14. 用htaccess进行访问控制(转)
  15. ----------- Rootkit 核心技术之绕过 IopParseDevice() 调用源检测逻辑 ---------------
  16. 模仿spring-aop的功能,利用注解搭建自己的框架。
  17. Java线程中的join使用实例
  18. zabbix监控交换机、防火墙等网络设备
  19. 爬虫scrapy的使用
  20. 关于java中String的用法

热门文章

  1. mmcrfs
  2. python pip 不能用报错: ImportError: No module named _internal
  3. django导出excel
  4. bzoj 3669 lct维护最小生成树
  5. 【BZOJ-3110】K大数查询 整体二分 + 线段树
  6. python开发_json_一种轻量级的数据交换格式
  7. GPS坐标定位与距离计算
  8. 设置Linux SSH登录后的欢迎信息
  9. lamp经典安装
  10. 知识共享 - creative commons