Title: Custom Post Type Conversion
Last modified: August 20, 2016

---

# Custom Post Type Conversion

 *  [polymaze](https://wordpress.org/support/users/polymaze/)
 * (@polymaze)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/custom-post-type-conversion/)
 * Can anyone help with how to use this with a custom post type?
 *     ```
       $cat_args = array(
       			'orderby' => 'name',
       			'order' => 'ASC'
       		);
       		$categories = get_categories($cat_args);
   
       		foreach($categories as $category) {
   
       			$args = array(
       					'category' => $category->term_id
       			);
       			$posts = get_posts($args);
   
       			if ($posts) {
   
       				echo '<p>Category: <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </p> ';
   
       				foreach($posts as $post) {
       					setup_postdata($post); ?>
       					<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
       					<?php
       				} // END foreach ($posts)
       			} // END if ($posts)
       		} // END foreach($categories)
       ```
   

Viewing 1 replies (of 1 total)

 *  Thread Starter [polymaze](https://wordpress.org/support/users/polymaze/)
 * (@polymaze)
 * [14 years, 5 months ago](https://wordpress.org/support/topic/custom-post-type-conversion/#post-2345950)
 * Anyone have a suggestion for this? Thanks

Viewing 1 replies (of 1 total)

The topic ‘Custom Post Type Conversion’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)
 * [conversion](https://wordpress.org/support/topic-tag/conversion/)
 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [polymaze](https://wordpress.org/support/users/polymaze/)
 * Last activity: [14 years, 5 months ago](https://wordpress.org/support/topic/custom-post-type-conversion/#post-2345950)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
