dtw52353 2011-05-16 05:29
浏览 47
已采纳

Wordpress php回声问题

Im trying to filter out all of the tags inside a post in wordpress using strip_tags(). I set it up like this:

<?php
// The Query
echo date ("Y");
query_posts( 'p=10' );
// The Loop
while ( have_posts() ) : the_post();
$footertext = the_content(); 
echo strip_tags($footertext);
endwhile;
// Reset Query
?>

This doesn't seem to strip out the tags they way I expected.

  • 写回答

1条回答 默认 最新

  • dquh37673 2011-05-16 05:34
    关注

    Change the_content() to get_the_content().

    the_content() is used to directly output the contents whereas get_the_content returns contents to be stored in variable for further processing.

    $footertext = get_the_content(); 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 目前主流的音乐软件,像网易云音乐,QQ音乐他们的前端和后台部分是用的什么技术实现的?求解!
  • ¥60 pb数据库修改与连接
  • ¥15 spss统计中二分类变量和有序变量的相关性分析可以用kendall相关分析吗?
  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab