18910140161

wordpress模板制作教程第二节

顺晟科技

2019-08-16 15:31:27

366

制作一个可以运行的wordpress主题:

第一步,准备静态页面,准备好的静态页面一般为html页面,需要转换为php格式。

第二步,制作index.php和style.css,将html后缀结尾的静态页面改为index.php。

第三步,给style.css添加版权信息

先给style.css添加版权信息

/*

Theme Name: wordpress theme1.0

Theme URI:

Description: a simple bolg theme

Author: xixi

Author URI:

Version: 1.0

Tags: ,chengjin, blue

*/

第四步:把主题上传到空间中wordpress安装路径,wp-content/themes/下面,这里主题的文件夹名字必须是英文

第五步,在wordpress后台启用主题

Style.css路径调用:<?php bloginfo( ‘stylesheet_url’ ); ?>

主题缩略图名字:screenshot.png

这样一个完整的index.php首页就出来了,然后将index.php主题结构进行划分,分为头部,主体,尾部,边栏

分别是index.php,header.php,footer.php,sidebar.php

把index.php拆分成header.php,footer.php和sidebar.phhp

<?php get_header();?> 头部调用

<?php get_footer();?> 尾部调用

<?php get_sidebar();?> 边栏调用

相关文章
我们已经准备好了,你呢?
2024我们与您携手共赢,为您的企业形象保驾护航