Targeting categories in custom fields (1 post)

  1. SugarTreeAdmin
    Posted 2 years ago #


    I was hoping somebody could help me out with custom fields.

    I created a custom post type called game-type in WordPress. In this I have the categories "Android", "iOS" and "PC", then within these I have categories for types of games "3D Action", "Classics", "Platform" etc.

    So an example hierarchy for each post works like this:
    Games > Android > 3D Action > Post (Game)

    So far I've managed to call a list of categories using the code:

    	//list terms in a given taxonomy using wp_list_categories (also useful as a widget if using a PHP Code plugin)
    	$taxonomy     = 'game-type';
    	$orderby      = 'name';
    	$show_count   = 0;      // 1 for yes, 0 for no
    	$pad_counts   = 0;      // 1 for yes, 0 for no
    	$hierarchical = 1;      // 1 for yes, 0 for no
    	$title        = '';
    	$args = array(
     	 'taxonomy'     => $taxonomy,
     	 'orderby'      => $orderby,
     	 'show_count'   => $show_count,
     	 'pad_counts'   => $pad_counts,
     	 'hierarchical' => $hierarchical,
     	 'title_li'     => $title
    	<?php wp_list_categories( $args ); ?>

    But this lists all the categories in my custom field. Is there a way to target just the categories in "android"?

    Your help would be much appreciated.


    Site: http://www.sugartree.org.uk/company

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 2 years ago by SugarTreeAdmin
  • This topic is not resolved
  • WordPress version: 3.5.1