Support » Fixing WordPress » custom post type display post belong on the category

  • 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

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘custom post type display post belong on the category’ is closed to new replies.