WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Sep 11 2012

How to Effectively Use the Blog Template with the Genesis Easter Egg, query_args, Pt 2?

In my previous post, How to Effectively Use the Blog Template with the Genesis Easter Egg, query_args, I discussed how to create single category pages and single custom post type pages with a caveat explained how to use shortcodes to get the desired content as well as the look and feel that you want.

However, if you wanted to get a bit more fancy like integrating multiple custom post types or multiple categories, that can be a bit more complicated. However, it isn't, if you know how to use query_args and query strings. With multiple categories, WordPress is looking for a comma separated (with no spaces!) list of categories. Your query_args would be: cat=3,7.

However, this will not work with post types! Instead you need to "build an array of post types via query string." Your query_args would be: post_type[]=post&post_type[]=wps_cpt1&post_type[]=wps_cpt2

So, if you wanted to combine the query where you show only posts from the post post type and your custom post type that share a specific category (WordPress built-in categories), then your query_args would be: cat=3&post_type[]=post&post_type[]=wps_cpt1.

So, when I said "your possibilities are almost endless" with using the Genesis Easter Egg, I meant that your possibilities are almost endless!

Written by Travis Smith · Categorized: WordPress

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

  1. Ahmad says

    October 16, 2012 at 12:08 am

    Hi, how do I create a blog page with certain tags?
    How about a blog page with certain post-formats?

    Reply
  2. Dieter says

    August 2, 2013 at 3:53 am

    Hi

    Thanks for the info. What if I want to show only posts if they belong to two categories at the same time (say id 16 and 17)?

    Reply

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.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in