The Stiz Media, LLC

Making your website work for you

  • Styles for Genesis
    • FAQs
  • Cart
  • My Account
  • Home
  • Web Design
  • Portfolio
  • Resources
  • Blog
  • Contact

Powerful websites, with style.

Home » Blog » Use WP_Query To Alter The Posts Per Page Of A Custom Taxonomy Term Archive Of A Custom Post Type

Use WP_Query To Alter The Posts Per Page Of A Custom Taxonomy Term Archive Of A Custom Post Type

June 21, 2013 Andhi 4 Comments

Wow, that title got me all dizzy. It’s okay though, it’s not that complicated, right?

I just wanted to get this posted before I forgot what I did and where I did it. Since I use custom post types and custom taxonomies quite a bit, I need to reference this code quite a bit.

On the current site I’m working on, here’s what I have:

  • Custom post type: Portfolio ( ‘portfolio’ )
  • Custom taxonomy: Portfolio Categories ( ‘portfolio_cat’ )
  • Portfolio category term archive: Media Analyst ( ‘media-analyst’ )

I put the following code in my taxonomy-portfolio_cat-media-analyst.php file.

WP_Query is extremely powerful, and the above code makes it easy for Genesis (affiliate link) to harness that power!

Check out the available arguments for WP_Query here.

Related Posts

  • A really organized life
    Genesis Page Templates in a subdirectory
  • Styles - Genesis
    How to customize any Genesis child theme without code
  • Remove Avatar
    Remove Avatar from Genesis Author Box

Genesis Framework, Tutorials WP_Query

‹ Remove The Comma Between Categories And Tags In Genesis
Sneak Peak of the new “Latent” child theme for Genesis 2.0 ›

Try The Most Powerful Genesis Child Theme Ever Created

Mai Theme is the most customizable Genesis child theme (and plugin!) available. Check it out now!

Learn More @ MaiTheme.com

Our posts, directly to your inbox

Comments

  1. lucas says

    December 11, 2014 at 2:04 pm

    I’m trying to put a custom loop together for an events CPT and this is a great snippet!
    I’m using ACF for the CPT which has a field of event_date. What would be the “orderby” if I wanted my posts to display by order date? I’m sure this is simple, but I can seem to find it.
    Thanks!

    Reply
    • JiveDig says

      December 11, 2014 at 3:25 pm

      Do you want the query to only include items that have a value in event_date? If so, you could add the meta_key to your query like ‘meta_key’ => ‘event_date’, and do orderby meta_value.

      It gets tricky when you add custom fields to the query like that, but it definitely can happen. 😉

      Reply

Leave a Reply Cancel reply

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

Our posts, directly to your inbox


Howdy, I'm Mike Hemberger. I like to build nice websites and web apps with WordPress and Genesis Framework.

I'm passionate about everything I do, and it resonates in all of my work.

Feel free to email, and you'll be speaking directly with me.

Recent Posts

Restful P2P Example

Create Posts 2 Posts ‘connections’ with the WordPress Rest API

EA Share Count SMS button

Add SMS share button to EA Share Count plugin

ACF Extras

ACF Extras officially launched! A community of code snippets and field groups

Remove Items from TinyMCE editor

Remove Buttons/Items From The WordPress TinyMCE Editor

  • My Account
  • Affiliate Area
  • Log In|Log Out
  • GitHub
  • Instagram
  • Twitter
  • YouTube

Copyright © 2025 · The Stiz Media, LLC · All Rights Reserved