Forum Replies Created

Viewing 5 replies - 16 through 20 (of 20 total)
  • Thread Starter mauricenaef

    (@mauricenaef)

    Hi t31os_

    got that with the order… but the list’s purpose is so I can output the values on different places within the loop, as in the example above I’m pulling out the dates to replace the values for all the the_time() values as I need a special date (custom field) and not the regualr wordpress post date if you understand….

    I’m still very confused why it’s behaving so strange…

    anyway will further pick my head… thank’s thou for the help so far!
    BR Marcel

    Thread Starter mauricenaef

    (@mauricenaef)

    If I attach all in one string like:

    <?php $customdate = get_post_meta($post->ID, "date_value", true); list($day, $month, $year) = explode("-", $customdate); echo $day;?>

    then it works, but I thought it sould be possible with normal php variables to make the code more legiable…. or am I mistaken?

    Thread Starter mauricenaef

    (@mauricenaef)

    If I input exactly what you suggest I get the same values, but if I just try and output as mentioned above It doesn’t output at all with echo $customdate;

    Could It have something to do with the loop? Sorry I’m really a php newbie..

    Thread Starter mauricenaef

    (@mauricenaef)

    @alchymath when I echo $customdate I don’t get any value at all…

    maybe it would help to see the whole query…

    <ul id="eventslist">
    <?php //The Query
    		$customdate = get_post_meta($post->ID, "date_value", true);
    		list($day, $month, $year) = explode("-", $customdate);
    			         query_posts('cat=4&meta_key=date&meta_compare=>&meta_value=,'.$today.'&orderby=meta_value&order=asc'); 
    
    //The Loop
    if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <li>
    <div class="eventdate">
    <div class="month m-<?php the_time('m') ?>"><?php the_time('M') ?></div>
    <div class="day d-<?php the_time('d') ?>"><?php the_time('d') ?></div>
    <div class="year y-<?php the_time('Y') ?>"><?php the_time('Y') ?></div>
    </div>
    <h3><?php the_title(); ?></h3>
    <p><?php echo $customdate ?></p>
    </li>
    <?php endwhile; ?>
    </ul>
    <?php else: ?>
    <h2>Keine Events</h2>
    <?php endif; wp_reset_query(); ?>
    Thread Starter mauricenaef

    (@mauricenaef)

    @t31os_Member, I get Array ( [0] => )? Only when I echo get_post_meta($post->ID, "date_value", true); I receive the value 2010-01-22 which is the date in the custom field? That’s why Im really scratching my head!

Viewing 5 replies - 16 through 20 (of 20 total)