Support

Account

Forum Replies Created

  • hi john,

    thanks.

    function content_image($i)
        {
        ?>
            <?php 
                $count = count(get_sub_field('content_images'));  
                
                if( have_rows('content_images') ) :  
                      
                    if($count == 1) { ?>
                        <section class="grid gap-4 mt-6">
                    <?php }elseif($count == 2) { ?>
                        <section class="grid md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-2 gap-4 mt-6">
                    <?php }elseif($count == 3) { ?>
                        <section class="grid md:grid-cols-3 lg:grid-cols-3 xl:grid-cols-3 gap-4 mt-6">
                    <?php } 
                    while( have_rows('content_images')) : the_row(); 
                        $image = get_sub_field('content_image'); ?>
                        <a data-fancybox="gallery" class="feature-zoom hover:shadow-2xl" href="<?= $image; ?>" title="&copy; <?php the_sub_field('content_image_copyright'); ?>" data-caption="&copy; <?php the_sub_field('content_image_copyright'); ?>">
                            <img src="<?= $image; ?>" title="&copy; <?php the_sub_field('content_image_copyright'); ?>" alt="">
                        </a>
                    <?php endwhile; ?>
                        </section>
                <?php endif; ?>
        <?php  
        }
  • this fix my issue

    `<?php
    $tagValue = get_field(‘related_places_by_tag’);
    $args=array(
    ‘tag_id’ => $tagValue,
    ‘posts_per_page’=>6 // Number of related posts to display
    );

    $my_query = new wp_query( $args );
    while( $my_query->have_posts() ) {
    $my_query->the_post();
    ?>
    <div>
    “>
    <?php the_title(); ?>

    </div>
    <?php }
    wp_reset_query();
    ?>’

  • hi John,

    thank you for your response. i found the simplest way to fixed this issue in the Backend with drag & drop

    thanks

  • Hi John,

    thank you for your response. I have fixed this issue with ->

    <?php
                    $date_from  = get_field( 'retreat_date_from' );
                    $date_to    = get_field( 'retreat_date_to' );
                    $date_1     = new DateTime(date('Y-m-d', strtotime($date_from)));
                    $date_2     = new DateTime(date('Y-m-d', strtotime($date_to)));
                    $days       = $date_1->diff($date_2)->days + 1;
    
                     // var_dump($days, $date_from, $date_to, $date_1, $date_2);
                     // var_dump(strtotime(get_field('retreat_date_to')));
                  ?>
    
                  <div class="uk-card-body uk-padding-small">
                    <span class="location-card"><?php the_field('retreat_location'); ?></span>
                      <a href="<?php echo the_permalink(); ?>"><h3 class="uk-card-title uk-margin-remove-bottom"><?php echo $days; ?> Tage <?php the_title(); ?></h3></a>
                      <p class="uk-margin-remove-top"><?php echo date_i18n('j F', strtotime($date_from)); ?> - <?php echo date_i18n('j F Y', strtotime($date_to)); ?></p>
    
                    </div>
  • hi,
    i have one issue.
    i can’t count the difference in October. other months works

  • hi bosoxbill,

    I solved this with

    <?php
      $date_from  = get_field( 'retreat_date_from' );
      $date_to    = get_field( 'retreat_date_to' );
    
      $date_1     = new DateTime(date('Y-m-d', strtotime($date_from)));
      $date_2     = new DateTime(date('Y-m-d', strtotime($date_to)));
    
      $days       = $date_1->diff($date_2)->days;
    ?>
Viewing 6 posts - 1 through 6 (of 6 total)