• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
NameHero® Blog

NameHero® Blog

Web Hosting Tips & Resources From NameHero

  • Hosting
    • Web Hosting
    • WordPress Hosting
    • WooCommerce Hosting
    • Enterprise Hosting
  • VPS
    • VPS Hosting
    • Flex VPS
  • Reseller
  • Email
  • Gaming
  • Domains
  • Website Builder
  • Account
  • Blog Home
  • Categories
  • Authors

How To Create An Archive Page In Genesis

Bhagwad Park

Published on: June 2, 2022

Categories: WordPress 0

Earlier, I’d written about how to create a category page in WordPress using the new and improved WordPress 6.0 Query Loop block. Unfortunately, this doesn’t work if you want to include all post types. The query loop block has an option on the right-hand side that allows you to choose either posts or pages for display. It doesn’t let you choose both. Here’s a screenshot:

WordPress Query Loop Block only Shows Posts OR Pages - Not both at the Same Time
WordPress Query Loop Block only Shows Posts OR Pages – Not both at the Same Time

By default, WordPress doesn’t allow you to add categories and tags to pages – only posts. A while back, I’d written an article on how add tags to WordPress pages. This is very useful, particularly if you’ve already created some pages and want to belatedly add tags to them. That article also included code to include both posts and pages in any tag query. Otherwise, even if you added tags to a page, they wouldn’t show up in the tag archives.

But the new Query Loop block has its own code and it can only show pages or posts. So while an ordinary archive page will show both post types, the Query Loop block from WordPress 6.0 will not. So we’re back to creating a page using an in-built template to get the results we want.

Since I use the Genesis theme on my website, I thought I’ll show you how to create an archive page using the “Blog” template on Genesis that only displays posts and pages from a single tag. You can modify this to show any category, or multiple tags, depending on the options you set using the “query_args” parameter as shown below.

Create a Page Using the “Blog” Template

Strangely, to create an archive page in Genesis, you should use the “Blog” template, and not the Archive template. The latter will output a sitemap-like list of titles, and doesn’t have the pagination you would expect from a category or a tag archive. So fire up a new page, and select the Blog template like this:

Choose the Blog Template in a Genesis Page
Choose the Blog Template in a Genesis Page

The Blog template has all the necessary tools to display a list of posts with featured images, excerpts, and “Next” and “Previous” pages as you would expect.

Crafting the “query_args” Parameter

By default, the blog template shows you a list of everything. But you can select what to show by properly constructing a “query_args” parameter. Here’s the full documentation for query_args, but it’s best illustrated with some examples:

To show only items tagged with “tech”:

tag=tech

To show items in tags 3 and 4:

tag__in= array( 3, 4 )

To show items in category 5:

cat=5

Exclude categories 7 and 8:

cat=-7,-8

Once you’ve figured out what kind of query_args parameter you want, scroll down to the bottom of the page editor till you come to a section labeled “Custom Fields”. Here, click “Enter new”, and in the “Name” field, type “query_args”, and in the “Value” field, type in the parameters you just determined. For example, I want to only show items tagged with “tech”. So my Custom Field screen looks like this:

Use the Right Query_Args Value
Use the Right Query_Args Value

Now save and publish your post. For me, this is the output:

Output Showing Posts and Pages from a Single Tag
Output Showing Posts and Pages from a Single Tag

As you can see, I have one page and one post tagged with “tech”, so both of these show up as expected. Note that this is only possible because I’ve implemented the code to add tags to pages, and got them to show up when tags are queried. If you want to do the same thing with categories, you need to modify the code accordingly.

Who knows, in the future, WordPress might expand the Query Loop Gutenberg block to allow us to include all kinds of post types, and not just either posts or pages. But until that happens, we have to continue using templates to achieve the results we want.

Bhagwad Park Profile Picture
Bhagwad Park

I’m a NameHero team member, and an expert on WordPress and web hosting. I’ve been in this industry since 2008. I’ve also developed apps on Android and have written extensive tutorials on managing Linux servers. You can contact me on my website WP-Tweaks.com!

Related Posts

What Is A WordPress Sitemap? (And How To Generate One)

Learn what sitemaps are, and discuss why you should have one for your WordPress site and how to create a sitemap and submit it.

How to Sell Ebooks on Your Website (In 4 Steps)

Check out our guide on how to build your website to sell Ebooks and stop getting profits siphoned away from Amazon and other marketplaces.

Why Is WordPress Down? 5 Possible Reasons

Let's go over five reasons that can cause your WordPress website to go down. For each we’ll show you how to fix it and prevent it!

Is WordPress Easy to Learn? A Beginner’s Guide

Let's take a closer look at WordPress and the things involved in creating a site on this CMS so you can learn and master the platform!

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Follow & Subscribe

Exclusive promos, content and more!


Most Popular Posts

NameHero’s Recommended WordPress Plugin and Theme Setup (2024)

WordPress Hosting vs. Web Hosting – What’s The Difference?

How To Increase The InnoDB Buffer Pool Size

How To Fix A Stuck All-in-One WP Migration Import

How To Add A Subdomain In Cloudflare

Top Categories

  • WordPress
  • WordPress Tutorials
  • Enterprise Hosting
  • WooCommerce
  • Web Hosting
  • Resellers
  • Website Security
  • Website Development
  • Website Performance
  • VPS Hosting
  • SEO Tips
  • Announcements
  • Domain Registration
NameHero

NameHero® proudly provides web hosting to over 40,000 customers with 99.9% uptime to over 750,000 websites.

  • Master Card
  • Visa
  • American Express
  • Discover
  • Paypal
Products
  • Web Hosting
  • VPS Hosting
  • Flex VPS Hosting
  • WordPress Hosting
  • WooCommerce Hosting
  • Reseller Hosting
  • Enterprise Hosting
  • Email Hosting
  • Game Hosting
  • Domains
  • Website Builder
Help & Support
  • NameHero Blog
  • NameHero Gaming Blog
  • Support
  • Help Center
  • Migrations
  • Affiliates
  • Gaming Affiliates
  • Call 1-855-984-6263
Company
  • About Us
  • Contact Sales
  • Reviews
  • Uptime
  • We're Hiring

Copyright © 2025 Name Hero, LLC. All rights reserved.
NameHero® is a registered trademark.

  • Privacy Policy
  • Terms of Use
  • Acceptable Use Policy
  • Payment Policy
  • DMCA