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

  1. jhunlio
    Posted 1 year 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. perthmetro
    Posted 1 year 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... :)

Topic Closed

This topic has been closed to new replies.

About this Topic