现在,如果节点类型是文章.在术语页面左侧,我想显示最新的10篇文章的标题,哪个节点类型是文章.我不想使用意见,我该怎么办?谢谢.
如果我想在节点页面的左边显示最新的10篇文章的标题,哪个节点类型是文章.如何编写查询.非常感谢.
ps:我发现EntityFieldQuery也许可以做到这一点,但我现在不知道如何做到这一点.
我的代码:
$query = new EntityFieldQuery();
$query
->entityCondition('entity_type', 'node')
->entityCondition('bundle', 'article')
->propertyCondition('status', 1)
->propertyOrderBy('created', 'DESC')
->range(0, 10);
$result = $query->execute();
Run Code Online (Sandbox Code Playgroud)