Quick Tip: Genesis Easter Egg

VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Genesis Query Args

This has already been somewhat documented throughout the Web, but for those that don’t know about it, Genesis includes an “easter egg” (it’s documented as such in the code) that allows you to turn any static page into a post archive.

To do so, edit the “Custom Fields” for the page. Add a new custom field with a key of query_args and then set a query string-formatted query to be used to determine which posts are shown in the archive. You should be able to use any parameter supported in the WP_Query class. For example, if you wanted to show a list of your most recent “portfolio” posts (assuming “portfolio” is the ID of a custom post type), the custom field value might look something like:

post_type=portfolio

That’s all there is to it.

One important note, though: if you want to change the number of posts shown on the page, you can’t use the posts_per_page or numberposts parameter; instead, you need to set the showposts parameter. So, if you only wanted to show the 5 most recent posts of the “portfolio” content type, your query value would look like:

post_type=portfolio&showposts=5

Finally, in order for this to work, you need to choose “Blog” from the “Template” selector. This will not work with “Default Template” or “Archive” set as the “Template” for the page.

VN:F [1.9.22_1171]
Rating: 3.0/5 (1 vote cast)
Quick Tip: Genesis Easter Egg, 3.0 out of 5 based on 1 rating

Leave a Reply