【问题标题】:Change title for specific Page?更改特定页面的标题?
【发布时间】:2015-12-10 12:44:28
【问题描述】:

我需要一些帮助..
我有以下功能来显示 cmets 部分的标题。

<?php comment_form(); ?>

如果我将其更改为以下内容:
&lt;?php comment_form(array('title_reply' =&gt; 'Comment with image' )); ?&gt; 我得到我想要的标题。
但我只想要页面(2123).. 我该怎么做?

【问题讨论】:

  • 而函数的代码是?
  • @SuperDJ 该函数的名称是“comment_form”。但是我只想在 page(2123) 中排列标题,但我不知道如何在代码中实现它...

标签: php wordpress function


【解决方案1】:

如果第 2123 页是指页面 id,那么

<?php if(get_the_ID() == 2123) comment_form(array('title_reply' => 'Comment with image' )); ?>

应该做的工作。这应该在循环内调用。

【讨论】:

    猜你喜欢
    • 2018-08-17
    • 1970-01-01
    • 2013-09-23
    • 1970-01-01
    • 1970-01-01
    • 2020-09-03
    • 1970-01-01
    • 2018-12-07
    • 1970-01-01
    相关资源
    最近更新 更多