Gutenberg용 시각적 쿼리 루프 빌더로 웹사이트에 동적으로 콘텐츠를 표시하세요. 이를 통해 사용자는 블로그 게시물, 사용자 지정 게시물 유형 및 페이지와 같이 웹사이트의 동적 콘텐츠를 표시하는 WordPress 레이아웃을 시각적으로 디자인할 수 있습니다.
GutenKit가 가져왔습니다 Gutenberg 편집기의 쿼리 빌더 블록 확장된 기능을 갖춘
블록이 어떻게 작동하는지 봅시다.
전제 조건 #
Gutenberg의 고급 쿼리 빌더를 사용하려면 WordPress 웹사이트에 GutenKit Pro 플러그인을 설치해야 합니다.
GutenKit 쿼리 루프 빌더 #
GutenKit Pro 플러그인을 설치한 후 쿼리 빌더 블록을 활성화해야 합니다.
- GutenKit -> 블록으로 이동합니다.
- 목록에서 쿼리 빌더 블록을 찾으세요.
- 토글 버튼을 켜서 블록을 활성화하세요.
편집기에 쿼리 빌더 블록 추가 #
WordPress 대시보드에서 쿼리 빌더를 사용하려는 페이지/게시물을 엽니다.
지금 검색하고 GutenKit 쿼리 빌더 블록을 클릭/드래그 앤 드롭하기만 하면 됩니다..
변형 중에서 쿼리 루프에 대해 사전 정의된 빈 템플릿을 선택합니다.
컨텐츠 부분 편집 #
쿼리 탭을 확장하면 다음이 표시됩니다.
- 질의 유형: 여기에서 게시물 유형을 게시물로 선택할 수 있습니다.
- 템플릿에서 쿼리 상속: 이 토글 버튼을 활성화하여 글로벌 쿼리 컨텍스트를 사용할 수 있습니다. 그렇지 않으면 설정을 독립적으로 사용자 지정하는 옵션을 비활성화합니다.
- 편집 쿼리: "템플릿에서 쿼리 상속"을 비활성화하면 쿼리 게시 편집기에서 사용 가능한 여러 쿼리 필터로 메뉴 방식으로 쿼리를 편집할 수 있습니다.
쿼리 게시물 편집기(쿼리 필터) #
When you click on the Edit Query option, you can customize the queries with filters like Post query, Taxonomy query, Meta query, Date query, and more. Let’s break them down step by step:
☑️ Posts #
You can customize the post queries with the following controls.
- Post Type: Select what kind of content you want to show. You can show Posts, Pages, Media, or any custom post type with the query builder.
- Post In: After selecting the post type, if you want to show some specific content (e.g. specific post, page, or other content) you can include them under the ‘Post In’ field.
- Parent In: For the pages, you can show pages under specific parent pages.
- Post Parent:
- Post Not In: In case you want to exclude specific posts or pages, you can list them under the ‘Post Not In’ field.
- Not in Parent: To exclude specific parent pages from showing them in the query loop.
☑️ Taxonomy #
With GutenKit Query Builder block, you can add multiple taxonomy queries and set their relation using AND-OR logic. By clicking on the ‘+ 항목 추가‘ button you can you can add taxonomy queries.
For each taxonomy item you have the following options:
- 분류: Select the taxonomy such as Categories, Tags, Groups, and others.
- Include Children: Show the posts under children taxonomies, such as child categories or tags.
- Terms: Based on the taxonomy you can choose their terms. For example, if you choose ‘Categories’ as taxonomy, you can choose specific categories.
- Operator: Operator defines the relation between the taxonomy terms. (To make it easier to understand, we will use “Categories” as an example and explain how the operators work based on this.)
- IN: To display posts that belong to any of the selected categories.
- NOT IN: To exclude the posts under the selected categories.
- AND: Shows only the posts that belong to all the selected categories simultaneously.
- EXISTS: To show posts that exist in at least one of the selected categories.
- NOT EXISTS: To display posts that do not exist in any of the selected categories.
All of these operators work the same for other taxonomies like tags, tabs, or any other custom category.
Relations:
As mentioned earlier, you can add multiple items for taxonomy queries and define their relationship using the Relation operator.
- AND: The post will appear in the query loop only if it meets the conditions of all specified taxonomy items.
- OR: The post will appear in the query loop if it meets the condition of at least one specified taxonomy item.
☑️ Meta Query #
GutenKit’s Query Builder also supports custom meta fields. Just add a meta key and meta value, choose a comparison operator, and define the meta type to display posts based on custom metadata.
To add meta query, you can start by clicking on the ‘+ 항목 추가‘ button. After that,
- Meta key:
- Meta Value:
- Meta Type:
- Meta Compare:
☑️ Date Query #
Move to the next tab to filter posts by 날짜 with the following options:
- Year
- Month
- Week
- 낮
- Hour
- Minute
- Second
Plus, you can set up comparisons between the queries.
- Date Compare: Set the operator to decide how the action will occur for the given date. For example, if you select the == operation, that means only the post published on the given date will be shown. Again, if you select the <= operator, this means the post published on or before that given date will be shown on the query loop.
☑️ Author #
Highlight posts by specific authors. You can show posts from a single author or multiple selected authors.
1. 작가: Select a single author to show his/her post on the web page.
2. Author Name (User Nice Name): You can enter a display name for that author you have just selected.
3. Author In: Otherwise, you can show posts from multiple authors by selecting authors in this field.
4. Author Not In: You can hide posts from specific authors by adding their names in this field.
☑️ Mime Types #
With GutenKit Query Loop Builder block you can show posts with specific types of media files. Under “Mine Types” you can select the media file type from the 90+ given options.
For example, if you select the ‘webp’ type, every post that has a ‘webp’ file will be shown on the query loop. The same goes for other mime types as well.
☑️ Comments #
Posts can also be shown based on the number of comments they have. Just set the comment count (Number of Comments) and adjust the conditions in the ‘Compare Number of Comments‘ field.
For example, if you set the number of comments to 5, and select the >= as operator (compare number of comments), the posts that have more than 5 comments will be on display.
☑️ Status #
Next up, control the post-visibility based on their status. This means whether you want to show the published posts, pending posts, or posts that will be published in future.
GutenKit’s Query Builder block for Gutenberg has the following post status available:
게시, 보류 중, Draft, Future, Private, Trash, 또는 Any status.
☑️ Password #
Filter password-protected posts:
- Yes: Show all password-protected posts.
- No: Display only non-password-protected posts.
- Password: Display posts with a specific password.
☑️ Order #
When it comes to ordering post, you have options to sort by Post ID, Author, Title, or Name, in ascending or descending order.
- 주문: Sort posts by post ID, Author, Title, name, or none.
- 주문하다: Choose ascending or descending order.
☑️ Search #
Simply show posts that have a specific search keyword in them, by adding that Keyword under the Search tab.
☑️ Pagination #
Configure the pagination for the query loop.
- Posts Per Page: Decide the number of post to show on a single page.
- Page: Set which page to start from.
- 오프셋: Select the default page number in pagination.
- Ignore Sticky Posts: By enabling this option you can hide the WordPress sticky post.
After you are done with editing query post filters, you can move on to customizing the appearance of the query template.