• Resolved fareed_khan

    (@fareed_khan)


    Hi

    https://vivocity.com.sg/dine

    I make a website like the one shown above….

    This is my website https://imfareed.com/personal/v-clone/…..

    When i click to any particular category like “breakfast and others” it gives the list of relevent hotles…

    This file is running dining.php and

    this is my code…..

    <div class=”row”>
    <h3 class=”col-lg-12 text-center margins-top-bot”>
    Select a Category</h3>
    <?php $dining = new WP_Query(array(
    ‘post_type’ => ‘dining’,
    ‘order’ =>’ASC’
    ));?>

    <?php while($dining->have_posts()) : $dining->the_post(); ?>
    <div class=”col-lg-2 col-sm-4 ful-size-pic”>
    “>
    <?php the_post_thumbnail();?>
    <p><?php the_title();?></p>

    </div><!– col-lg-2-end –>
    <?php endwhile;?>
    </div><!– Row-End –>

    I have made one category but still it is not showing….

    kindly advise whether a seperate code will be required for it in single-dining.php

    https://www.ads-software.com/plugins/custom-post-type-ui/

Viewing 1 replies (of 1 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    You’re not doing anything to display associated categories/taxonomy terms in that loop. I believe get_the_categories() is the one you want for the out-of-box categories, and get_the_terms() for any custom taxonomy.

Viewing 1 replies (of 1 total)
  • The topic ‘How to make different categories parent and child categories’ is closed to new replies.