Wordpress Etkinlik Listesi Tarih Sorun

0 Cevap php

Ben wordpress doğru sırayla olayları görüntüleyen bir sorun yaşıyorum. Ben wordpress bir dize olarak tarih tedavi ve İngiliz tarih biçiminde çünkü gün onu sipariş çünkü sorun olduğunu düşünüyorum.

Amaç listenin en üstünde en güncel olay ile gelecekteki olayların bir listesini görüntülemek için. Ama gg / aa / yyyy ingiliz tarih biçimini kullanmalısınız.

Ben silbaştan gitmek gerekiyor veya ihtiyaç sonuca ulaşmak için tarih dönüştürme bir yolu var mı?

Şimdiden teşekkürler :)

<ul>
<?php // Get today's date in the right format
$todaysDate = date('d/m/Y');?>

<?php  query_posts('showposts=50&category_name=Training&meta_key=date&meta_compare=>=&meta_value=' . $todaysDate . '&orderby=meta_value&order=ASC'); ?>

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <li>
      <h3><a href="<?php the_permalink(); ?>">
        <?php the_title(); ?>
        </a></h3>
        <?php $getDate = get_post_meta($post->ID, 'date', TRUE);
        $dateArray = explode('/', $getDate); ?>
        <?php if($getDate != '') { ?>
            <div class="coursedate rounded"><?php echo date('d F Y', mktime(0, 0, 0, $dateArray[1], $dateArray[0], $dateArray[2])); ?></div>
        <?php } ?>
        <p><?php get_clean_excerpt(140, get_the_content()); ?>...</p>
        <p><strong><a class="link" href="<?php the_permalink(); ?>">For further details and booking click here</a></strong></p>
    </li>
    <?php endwhile; ?>
    <?php else : ?>
        <li>Sorry, no upcoming events!</li>
<?php endif; ?>

0 Cevap