douwu7563 2011-11-26 15:07
浏览 38
已采纳

在functions.php [Wordpress]中添加函数的问题

I write function in functions.php like this

function out() {
  $s = 'End of the post, thanks for reading';
  return $s;
}

add_filter('the_content','out');

and I expect this to be fetched at the end of the post, after entry content. But all it does is that post entry ( what the_content outputs) is not shown, and I only get 'End of the post, thanks for reading'.

What am I doing wrong?

  • 写回答

2条回答 默认 最新

  • doudou2121 2011-11-26 15:13
    关注

    Try this:

     function out($content) {
         return $content." End of the post, thanks for reading";
    }
    
    add_filter( 'the_content', 'out' );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏