2011-04-04 29 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