items
Returns an array of posts
items that match the query.
Description
items
contains the current page of results retrieved by the query.
If no results match the query, items
is an empty array.
The page size is defined by the limit()
function and can be retrieved using the pageSize
property. You can use the next()
and prev()
functions returned by posts
to navigate the pages of a query result.
Type:
NAME
TYPE
DESCRIPTION
Post ID.
Whether commenting on the post is enabled.
Reserved for internal use.
Reserved for internal use.
The post's content in plain text.
Reserved for internal use.
Post excerpt. Can be selected by a site contributor. By default, it is extracted from the content text's first characters.
Max: 500 characters
Whether the post is marked as featured.
Date the post was first published.
Indicates if there is a draft post with changes that have not yet been published.
Hashtags in the post.
Image placed at the top of the blog page. Only displays on mobile devices.
Reserved for internal use.
Reserved for internal use.
Reserved for internal use.
Date the post was last published.
Post cover media.
Estimated reading time.
Post moderation details.
Only relevant to posts submitted by guest writers. Guest writers have the ability to write posts but not publish them. These posts can be rejected or approved for publishing by a blog editor or site owner.
Reserved for internal use.
Whether the post is pinned. If true
, the post is placed at the top of the post list.
Whether the returned content is a preview of premium content. Defaults to false
.
A preview displays a limited number of paragraphs of paid content to non-subscribed users.
Pricing plan IDs.
If a post is assigned to a specific pricing plan.
IDs of posts related to the post.
Post rich content
SEO data.
Part of a post's URL that refers to a specific post.
For example, 'https:/example.com/posts/my-post-slug'
.
Post title.
ID of the post's translations when Wix Multilingual is installed on a site. All translations of a single post will share the same translationId
.
Post URL.
Was this helpful?
items
from a query result1const returnedItems = results.items;2
items
from the result1import { posts } from 'wix-blog-backend';23export async function myQueryFunction() {4 const results = await posts.queryPosts().find();56 const returnedItems = results.items;78 if (returnedItems.length > 0) {9 return items;10 } else {11 // Handle if no matching items found12 }13}14