你能帮我做点简单的事吗?
如何获取上次批准评论的帖子id?我想把它赋给一个变量。
提前非常感谢!
你能帮我做点简单的事吗?
如何获取上次批准评论的帖子id?我想把它赋给一个变量。
提前非常感谢!
<?php
$recent_comments = get_comments( array(
\'number\' => 1,
\'status\' => \'approve\'
) );
foreach($recent_comments as $comment) :
$latest_postid_with_comment = $comment->comment_post_ID;
endforeach;
?>
可能是将此代码压缩为更小的内容的方法。但这会奏效的。我的网站上有一些不同的搜索:“物种概况”(自定义帖子类型搜索)术语表(自定义帖子类型搜索)目前我正在使用search.php; $_POST[\"type\"] 确定已使用的搜索,以及$_POST[\"s\"] 对于查询条件:<?php if (isset($_POST[\"s\"])) { $search_term = $_POST[\"s\"]; } if (isset($_POST[\"type\"])) {&#