Thanks for helping, it works fine with the frontpage-news although, but when I try it with the php code on the frontpage to get the news of the movies and music subdomains the whole page gets blank. This is the code I use on the frontpage to get the news (posts) from the movies.klifix.nl and music.klifix.nl:
<b>Laatste Filmnieuws:</b></font>
<?php
$today = current_time('mysql', 1);
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title, post_date FROM movies_posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5")):
?>
<?php
foreach ($recentposts as $post) {
if ($post->post_title == '')
$post->post_title = sprintf(__('Post #%s'), $post->ID);
$posttime = strtotime($post->post_date);
$mytime = date('<font color="red">H:i</font>', $posttime);
$mydate = date('<font color="red">d/m</font>', $posttime);
$currtime = time();
$today = date('d',$currtime);
$postday = date('d',$posttime);
if($postday==$today)
echo $mytime;
else
echo $mydate;
echo " ID'>";
the_title();
echo '
';
}
?>
<?php endif; ?>
and this is how I modified it:
<b>Laatste Filmnieuws:</b></font>
<?php
$today = current_time('mysql', 1);
function truncate($string,$chars,$append = '...') {
if(strlen($string) > $chars) {
$string = substr($string, 0, $chars);
$trunc_at = strrpos($string, ' ');
if($trunc_at !== FALSE)
$string = substr($string, 0, $trunc_at);
$string = $string.$append;
}
return $string;
}
if ( $recentposts = $wpdb->get_results("SELECT ID, post_title, post_date FROM movies_posts WHERE post_status = 'publish' AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 5")):
?>
<?php
foreach ($recentposts as $post) {
if ($post->post_title == '')
$post->post_title = sprintf(__('Post #%s'), $post->ID);
$posttime = strtotime($post->post_date);
$mytime = date('<font color="red">H:i</font>', $posttime);
$mydate = date('<font color="red">d/m</font>', $posttime);
$currtime = time();
$today = date('d',$currtime);
$postday = date('d',$posttime);
if($postday==$today)
echo $mytime;
else
echo $mydate;
echo " ID'>";
$shorten_title = truncate($post->post_title, 30);
echo $shorten_title;
echo '
';
}
?>
<?php endif; ?>