• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2671

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Tutorial Requests
  • Contact
  • Videos
  • Tags
  • Log in

Premium Member? - Request custom code

Template To Display Posts From Specific Sub or Child Categories

This template enables you to display a list of sub categories with the name of the sub category followed immediately by all posts attached to the sub category like this:

Update : Here’s a newer solution which enables you to use any taxonomy type and display each post in any type of grid layout using even or uneven widths & heights.

child-categories

The code prints the:

  • Child category name for each category you add using its i.d.
  • Description for each child category, if added.
  • All posts assigned to each child category.

You can control exactly which sub categories are included or excluded using any of the get_terms parameters.

'include' Array or comma/space-separated string of term ids to include.

Use like this:

$include = array( '56','57' );

In the above code swap out the sub category i.d’s with your own. Each i.d should be wrapped in single quotes like this ‘1’ and seperated by a comma.

Here’s the template you can download and add to your child themes root directory.

Register for full access

Related Tutorials

  • List Child Categories of Parent Category With Image
  • List Categories & Posts for All Categories on 1 Page

Child / Sub Categories

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Brad Dalton Specializes In Genesis child theme customization & code modification. Read More…

Learn PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems