我是WordPress的新手。我的问题是我创建了一个名为Atividades
当我创建帖子时,它不会出现在网站上。
// fuctions.php
add_action( \'init\', \'create_post_type\' ); function create_post_type()
{ register_post_type( \'acme_atividade\', array( \'labels\' => array(
\'name\' => __( \'Atividades\' ),
\'singular_name\' => __( \'Atividade\' ) ), \'public\' => true, \'has_archive\' => true, ) ); }
// index.php
<div id="atividades">
<div id="col1">
<div style="background: url(\'<?php echo $thumbnail; ?>\') no-repeat;" id="q-1">
<?php
$thumbnail = \'\';
if (function_exists(\'has_post_thumbnail\')) {
if ( has_post_thumbnail() ) {
$thumbnail = get_the_post_thumbnail($post->ID,\'thumbnail\');
}
}
?>
<?php
query_posts(array(
\'post_type\' => \'Atividades\',
\'posts_per_page\' => 1
) );
?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>
<h1 class="title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
<?php the_content(); ?>
<?php endwhile; else: ?>
<h1 class="title">Ups...</h1>
<p>... pedimos desculpa mas nenhum <em>post</em> foi encontrado!</p>
<?php endif; ?>
<p align="center"><?php posts_nav_link(); ?></p>
</div>
</div>
</div>
有什么问题吗?