嗯,你需要index.php, category.php, single.php, header.php 和footer.php.
代码应该是这样的:
index.php
<?PHP
$category_ids = get_all_category_ids();
sort($category_ids);
foreach($category_ids as $cat_id):?>
<!-- Category Start -->
<div class="category" id="cat-<?PHP echo $cat_id; ?>">
<!-- Category Title -->
<div class="cat-title"> <a href="<?PHP echo get_category_link( $cat_id ); ?>">
<h1><?PHP echo get_cat_name($cat_id); ?></h1>
</a> </div>
<!-- // Category Title End -->
</div>
<!-- // Category End -->
<?PHP endforeach; ?>
<?PHP get_footer(); ?>
category.php<?PHP get_header(); ?>
<?PHP if( have_posts() ): while( have_posts()) : the_post(); ?>
<!-- Content Post Start -->
<div class="content-post">
<h1><a href="<?PHP the_permalink(); ?>">
<?PHP the_title(); ?>
</a> </h1>
</div>
<!-- // Content Post End -->
<?PHP endwhile;
endif;
?>
</div>
<!-- // Content End -->
<?PHP get_footer(); ?>
single.php<?PHP get_header(); ?>
<!-- Content Start -->
<?PHP if( have_posts() ): while( have_posts()) : the_post(); ?>
<!-- Content Post Start -->
<div class="content-post">
<h1><a href="<?PHP the_permalink(); ?>">
<?PHP the_title(); ?>
</a> </h1>
<div class="post-info">
<div class="date"><?PHP the_time(\'M d, Y\'); ?></div> BY <?PHP the_author(); ?>
</div>
<?PHP echo get_post_image(); ?>
<?PHP the_content(); ?>
</div>
<!-- // Content Post End -->
</div>
<!-- // Content End -->
<?PHP get_footer(); ?>
在
header.php 您应该包括css/js文件。
This link can help you to build the structure of the wordpress theme