Skip to content

Instantly share code, notes, and snippets.

@sunilw
Created November 16, 2021 08:40
Show Gist options
  • Select an option

  • Save sunilw/114d4dcb66d7e1a817e6800ba3e09331 to your computer and use it in GitHub Desktop.

Select an option

Save sunilw/114d4dcb66d7e1a817e6800ba3e09331 to your computer and use it in GitHub Desktop.

Revisions

  1. sunilw created this gist Nov 16, 2021.
    87 changes: 87 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,87 @@
    /* the function that loads the template with the loop */

    function ginza_menu_display() {
    if ( class_exists('ACF')) {

    ob_start() ;

    require get_stylesheet_directory() . '/loops/ginza-menu-display.php' ;

    echo ob_get_clean() ;

    }
    }

    /** the loop **/

    <?php
    /**
    * Presentation of Ginza Menus
    */

    $args = array(
    'posts_per_page' => 2,
    'post_type' => 'ginza_menu'
    ) ;
    $my_query = new WP_Query($args) ;

    ?>
    <?php if ($my_query->have_posts()) : ?>
    <section id="ginza-menus">
    <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>


    <article class="ginza-menu" >

    <div class="thumb-container">
    <?php echo get_the_post_thumbnail() ?>
    </div>

    <div class="course-details">

    <header>
    <h4 class="menu-title"><?php the_title() ?></h4>
    </header>


    <div class="details-inner">

    <div class="courses">

    <div class="entrees">
    <h4 class="ginza-submenu-header">Entrees</h4>
    <ul>
    <?php while(have_rows('entree')) : the_row(); ?>
    <?php $item = get_sub_field('item'); ?>
    <li><?php echo $item ?></li>
    <?php endwhile ?>
    </ul>
    </div>


    <div class="mains">
    <ul>
    <h4>Mains</h4>
    <?php while(have_rows('mains')) : the_row(); ?>
    <?php $item = get_sub_field('item'); ?>
    <li><?php echo $item ?></li>
    <?php endwhile ?>
    </ul>
    </div>

    </div> <!-- ENDS .courses -->

    <div class="price">
    <?php $price = get_field('price') ?>
    <p><?php echo $price ?></p>
    </div>
    </div> <!-- ENDS .details-inner -->

    </div> <!-- ENDS .course-details -->

    </article> <!-- ends .ginza-menu -->

    <?php endwhile; ?>
    </section> <!-- ENDS #ginza-menuis-container -->
    <?php endif; ?>
    <?php wp_reset_query(); ?>