I am new to WordPress. My problem is that I created a custom post type named Atividades and when I create a post, it does not appear on the website.
// 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>
Is there anything wrong?
