这是插件:http://www.atlanticbt.com/blog/countdown-timer-in-wordpress/我想使用此处描述的功能(在链接中)将其集成到我的主题中,但我不知道该怎么做。这是代码(它显示一个类别中的3个帖子),我想要整合它:
<?php
$thumbnails = get_posts('numberposts=3&cat=3');
foreach ($thumbnails as $thumbnail) {
if ( has_post_thumbnail($thumbnail->ID)) {
echo '<div class="contest-home"><a href="' . get_permalink( $thumbnail->ID ) . '" title="' . esc_attr( $thumbnail->post_title ) . '">';
echo get_the_post_thumbnail($thumbnail->ID, 'medium', array('class'=> "blur") );
echo '</a>';
echo '<h2><center>' . esc_attr( $thumbnail->post_title ) . '</center></h2>';
echo get_post_meta($thumbnail->ID, "RiassuntoHome", true);
echo '<p><b>Giorni restanti:</b> Here it should be the function';
echo '<br><b>Premio: </b>'. get_post_meta($thumbnail->ID, "Montepremi", true) . '';
echo '</p><center><a class="btn-contest-home" href="' . get_permalink( $thumbnail->ID ) . '">Invia la Tua Idea</a></center></div>';
}
}
?>
答案 0 :(得分:1)
使用短代码,您希望显示定时器短代码,如[countdown_timer]
这里是短代码http://s.wordpress.org/plugins/countdown-timer-abt/screenshot-2.png?r=819719
中更多参数的类似内容如果你喜欢在php文件中使用这个简短的用法