Documentation › Using the Custom Query Mode of the Content Block

Using the Custom Query Mode of the Content Block

We see many issues relating to people not using the Custom Query mode of the content block correctly. If you activate Custom Query mode, it activates a new tab in the block options that allows you to have more options over the content you display in the content block.

Basics

hw-content-cq-1

hw-content-cq-2

Displaying a Page

If you want to display a page on a layout that would not normally display a page or display more than one page on a layout, you might find the “Fetch Page Content” option useful.

Choose the page you want to display in the dropdown.

hw-content-cq-3

Please note: If you fetch a page, then the rest of the “Query Filter” options will not work since they apply to posts only.

Filtering Posts

If you want to show Posts, do not choose anything in the “Fetch Page Content” dropdown because once you do the rest of the filter options do not work since they only filter posts.

An incorrect method of of showing posts is fetching the page you have set to show the blog posts. Do not do this. Simply leave the “Fetch Page Content” option alone and then choose your filter options.

For example, if I wanted to show posts only from a certain category, I’d choose my category and leave the method at include.

hw-content-cq-4

You can also combine filtering methods.

hw-content-cq-5

This would only show posts by Test User in the Updates category!

Other Options

Depending on what you want to do, the Listing Block might better suit your needs. For example, if you just want a list of post titles without pagination options, I’d probably go with the Listing Block. The Listing Block does not show any post content (excerpt or full post) but lets you filter by more taxonomies as well.

Caveats

Pagination with a custom WordPress query is tricky.  At this time, pagination (show older/newer posts) does not work correctly if using a custom query.


This article was last updated for Headway version 3.8.3

Copyright © 2016 Vesped Inc. All Rights Reserved. Proudly Powered by Headway and WordPress