Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何自定义wordpress主页?_Wordpress - Fatal编程技术网

如何自定义wordpress主页?

如何自定义wordpress主页?,wordpress,Wordpress,我是wordpress的新手,我正在使用wordpress创建一个网站 你可以在这里看到模型页面 我将index.php更改为 <?php get_header(); //get_template_part( 'loop', 'index' ); ?> <div class="flt_left"> //dummy welcome text .. </div> <div class="flt_left"> //dummy la

我是wordpress的新手,我正在使用wordpress创建一个网站

你可以在这里看到模型页面

我将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中

此外,我希望用户应该能够从管理面板编辑虚拟欢迎文本


一般来说,我想
如何分割wordpress
中的内容,以及
如何让管理员对其进行编辑,以及
如何将其包含在页面中

这是您的simple index.php文件(来自wordpress经典主题)中应该包含的内容:


—  
@ 


我建议您先读一读:

我使用的是最新的wordpress,index.php只有get_template_部分('loop','index');您可以链接其他教程来创建自定义主页吗?据我所知,这个新功能
get\u template\u part
有助于创建子主题。看看这篇文章:我们可以在管理页面中为虚拟欢迎文本设置一个页面或块,他可以在其中编辑内容,从而更改主页内容。。我可以将内容包含在php文件中,并使用get_advt()之类的工具,但我不想编辑php文件,我想让我的管理员编辑管理面板中的内容,就像wordpress中的页面一样。。如果可以,那么如何创建和包含它们呢?@kvijayhari:如果这是首要要求,那么我建议使用默认主题附带的原始index.php。一旦你从wordpress管理员创建了一个帖子/页面并发布了它,你就会得到一个由wordpress生成的URL。该帖子/页面在WYSIWYG wordpress html编辑器中始终是可编辑的,并由默认主题的索引、页眉、页脚、边栏等自动包装。帖子将由index.php自动包装,但页面将如何用默认的index.php包装?
<?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; ?>