WordPress.org

Forums

custom post type display post belong on the category (2 posts)

  1. jhunlio
    Member
    Posted 9 months ago #

    I have a custom post type:'advice' and 'taxonomies' => array('adcat'), and I want to display all post belong to that category.

    let says i have 4 categories namely : 'games', 'tours', 'dishes', 'hotels' and also this four category is a menu. if I click one of the category for example: hotels all post belong to the hotels should display.

    by the way this code I used to show wordpress default categories:

    <?php $catname = wp_title('', false); ?>
    <?php $posts = get_posts("category_name=$catname&numberposts=8&offset=0");
    foreach ($posts as $post) : start_wp(); ?>
    
    //html output
    <h1><?php the_title(); ?></h1>
    
    <?php endforeach; ?>

    this is not working in custom post 'taxonomies' any suggestion would be helpful thank's

  2. Please Add Screenshots
    Member
    Posted 9 months ago #

    I have no idea but I think the one's that do know tend to hang around in this sub forum for questions like yours... :)
    http://wordpress.org/support/forum/hacks

Reply

You must log in to post.

About this Topic