Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Waiting for user confirmation] Show child post date field using conditional

$
0
0

I made some changes to your code, which was showing the strtotime calculation field. Nevertheless, I still can't make it to work.

<?php echo "<b>Datas de início:</b><br />" ?>
<?php
$child_posts = types_child_posts("evento");
foreach ($child_posts as $post) {
    echo types_render_field("local", array('raw' => 'false')) . ": ";
    'Current time: '.time().', Field time: '.strtotime( types_render_field( "data", array('style' => 'text', 'format' => 'M j, Y H:i') ) ).'<br>';
    if ( strtotime( types_render_field( "data", array('style' => 'text', 'format' => 'M j, Y H:i') ) ) > time() ){
        echo types_render_field("data", array('style' => 'text', 'format' => 'd M')) . "<br />";
    }
    elseif ( strtotime( types_render_field( "data", array('style' => 'text', 'format' => 'M j, Y H:i') ) ) < time() ){
        echo "data a definir <br />";
    }
    else {
        echo "a definir <br />";
    }
}
?>

Thanks for your help.

Happy hollidays!

Alvaro


Viewing all articles
Browse latest Browse all 20145

Trending Articles