2011-04-04 30 views
0

我是新的WordPress的,我创建一个网站使用wordpress。如何自定义WordPress的主页?

你可以看到模拟了页面在这里http://www.site2preview.com/veejata/ver1/index.html

,我已经改变了的index.php作为

<?php 
get_header(); 

//get_template_part('loop', 'index'); 
?> 

<div class="flt_left"> 
    //dummy welcome text .. 
</div> 
<div class="flt_left"> 
    //dummy latest post.. 
</div> 

<?php get_sidebar(); ?> 
<?php get_advt(); ?> 
<?php get_footer(); ?> 

现在我想知道如何创建一个自定义的页面或区块,以及如何能我将它们包括在index.page ..

此外,我想用户应该能够编辑从管理控制台中的虚拟文本的欢迎..

在属李想how to split the contents in the wordpresshow to make them editable by adminhow to include them in the pages ...

回答

1

这是你应该在你的简单的index.php文件的内容(从WordPress的经典主题):

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>  
<?php the_date('','<h2>','</h2>'); ?>  
<div <?php post_class() ?> id="post-<?php the_ID(); ?>"> 
    <h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"> 
    <?php the_title(); ?></a></h3> 
    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> 
     &#8212; <?php the_tags(__('Tags: '), ', ', ' &#8212; '); ?> 
     <?php the_author() ?> @ 
     <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>  
    <div class="storycontent"> 
     <?php the_content(__('(more...)')); ?> 
    </div>  
    <div class="feedback"> 
     <?php wp_link_pages(); ?> 
     <?php comments_popup_link(__('Comments (0)'), 
      __('Comments (1)'), __('Comments (%)')); ?> 
    </div>  
</div>  
<?php comments_template(); // Get wp-comments.php template ?>  
<?php endwhile; else: ?> 
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p> 
<?php endif; ?> 

我会建议你先看看这个:http://codex.wordpress.org/Theme_Development

+0

我使用的是最新的wordpress和index.php只有get_template_part('loop','index');你可以请链接任何其他教程来创建自定义主页 – Vijay 2011-04-04 05:47:13

+0

据我了解这个新功能'get_template_part'有助于创建子主题。看看这篇文章:http://voodoopress.com/2011/02/get_template_part-in-my-wordpress-theme/ – anubhava 2011-04-04 05:56:19

+0

我们可以有一个页面或阻止虚拟欢迎文本在他可以编辑的管理页面的内容,使主页的内容变化..我可以包括在PHP文件中的内容和使用像get_advt(),而不是编辑PHP文件,我想让我的管理员编辑管理面板的内容非常类似于WordPress的网页。如果是的话,那么如何创建并包含它们呢? – Vijay 2011-04-04 06:10:36