WordPress.org

Support

Support » Themes and Templates » Creating a post type list

Creating a post type list

  • sheyes@s-heyes.com
    Participant

    @sheyess-heyescom

    I’ve managed to create a list using the below snippet of code I found online

    $taxonomy     = 'creditlibrary_type';
    $orderby      = 'name';
    $show_count   = 1;      // 1 for yes, 0 for no
    $pad_counts   = 1;      // 1 for yes, 0 for no
    $hierarchical = 1;      // 1 for yes, 0 for no
    $title        = '';
    
    $args = array(
      'show_option_all'    => '',
      'taxonomy'     => $taxonomy,
      'orderby'      => $orderby,
      'show_count'   => $show_count,
      'pad_counts'   => $pad_counts,
      'hierarchical' => $hierarchical,
      'title_li'     => $title
    );
    ?>
    
    <ul>
    <?php wp_list_categories( $args ); ?>
    </ul>

    The above code generates the following
    http://www.creditmatters.com.php53-13.ord1-1.websitetestlink.com/credit-library/

    How can I make this code list the post under each ‘taxonomy’? For example under “How To Read A Credit Report” I need to list the 4 posts that it shows in the brackets, and then link to that post?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Creating a post type list’ is closed to new replies.