【发布时间】:2016-03-25 03:52:50
【问题描述】:
我需要在一个简短的 div 中列出我今天的 wordpress 文章。 到目前为止,我(我认为我)已经编写了一个合适的代码来列出今天的文章,但出于某种原因,它是这样写的:
致命错误:调用未定义的函数 add_action() /home/u783756934/public_html/wp-content/themes/wordplus/functions.php 第 30 行
我的代码是这样的:
<?php
include "functions.php";
$query = new WP_Query( 'year=' . the_time('Y') . '&monthnum=' . the_time('m') . '&day=' . the_time('d') );
$posts = $query->get_posts();
foreach ( $posts as $post )
{
echo($post->post_title);
}
?>
我的 functions.php 文件是原始文件且未经编辑。
TLDR: 我需要列出今天发布的文章,以便将输出嵌入到另一个网站。
【问题讨论】: