Categories
CMS Mastering Development Wordpress

(there is nothing to show) is not work

variable $find doesn’t work correctly

my english is not good

please help me

function wtable_days() { ?>


<div class="wtable" id="wtable">
    <?php $days = array('Saturday', 'Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday');
        $i = 0;
        foreach ($days as $day) {
            echo '<a class="item item_wt_day'.$i.'" data-id="'.$i.'">'.$day.'</a>';
            $i++;
        }
    ?>
    <div class="keeper">
        <div class="mover">
        <?php $j = 0; foreach ($days as $day) { ?>
            <div class="vebeet-table-cell cell" id="cell<?php echo $j ?>">


<?php $new_loop = new WP_Query(array('post_type' => 'series', 'posts_per_page' => -1)); ?>      
<?php if ( $new_loop->have_posts() ) : ?>
    <?php while ( $new_loop->have_posts() ) : $new_loop->the_post(); ?>                  
            <?php if (get_field('selday') == $day) { ?>                

                    <div class="tbls">
                        <div class="tabs">
                            <a href="<?php the_permalink(); ?>"><?php the_field('farsiname'); ?></a>
                        </div>
                        <?php if (get_field('chaenc')) { ?>
                        <div class="tabs"><?php the_field('chaenc'); ?></div>
                        <?php } ?>
                        <?php if (get_field('seaenc')) { ?>
                        <div class="tabs"><?php the_field('seaenc'); ?></div>
                        <?php } ?>
                        <?php if (get_field('parenc')) { ?>
                        <div class="tabs"><?php the_field('parenc'); ?></div>
                        <?php } ?>
                        <?php if (get_field('imgenc')) { ?>
                        <div class="cover">
                            <a class="effect-im tab-img" href="<?php the_permalink(); ?>">
                                <?php echo wp_get_attachment_image(get_field('imgenc')); ?>
                            </a>
                        </div>
                        <?php } ?>
                    </div>

                    <?php $find = 1; ?>

                <?php } ?>                  
    <?php endwhile; ?>
<?php endif; ?>
<?php wp_reset_query(); ?>   



                    <?php if (empty($find)) { ?>
                    <div class="tbls">
                        <div style="width: 100%;" class="tabs">There is nothing to show</a></div>
                    </div>
                    <?php } ?>

            </div>
        <?php $j++; } ?>
        </div>
    </div>
</div>      



<?php }

Leave a Reply

Your email address will not be published. Required fields are marked *