我想创建自己的wordpress主题,因为我有自己的HTML模板,我想将此HTML模板转换为wordpress主题,因此,我复制了内置的wordpress主题“Twenty17”,并复制了我的CSS&;JS文件到wordpress主题根目录/资产/css(&;js文件夹。之后,我将html和;页脚页并提供了我自己的css&;js url的,对于主页,我需要一个模板页,所以,我创建了一个模板页,并包含标题和;使用“get\\u header()”的页脚文件(&;)get\\u footer()\'方法在模板页的中间,我复制了所有html代码。最后,我创建了一个新的wordpress页面并分配了这个模板。My problem here is only header&footer content is getting loaded but template page content is not loaded.
模板主页。php
<?php
/* Template Name: home */
get_header();
?>
<div id="theme-main-banner" class="banner-three gradient-banner-three">
---------------------------
HTML content goes here..
------------------------
</div>
<?php
get_footer();
?>
标题。php
<?php
/**
* The header for our theme
*
* This is the template that displays all of the <head> section and everything up until <div id="content">
*
* @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
* @version 1.0
*/
?><!DOCTYPE html>
<html <?php language_attributes(); ?> class="no-js no-svg">
<head>
<meta charset="<?php bloginfo( \'charset\' ); ?>">
<!-- For Resposive Device -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- For IE -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- <link rel="profile" href="http://gmpg.org/xfn/11"> -->
<title>My-Site-Title - App Landing Page</title>
<!-- Favicon -->
<link rel="icon" type="image/png" sizes="56x56" href="<?php bloginfo(\'template_url\')?>/assets/images/fav-icon/icon.png">
<!-- Main style sheet -->
<link rel="stylesheet" type="text/css" href="<?php bloginfo(\'stylesheet_directory\') ?>/assets/css/styles.css">
<!-- responsive style sheet -->
<link rel="stylesheet" type="text/css" href="<?php bloginfo(\'stylesheet_directory\') ?>/assets/css/responsive.css">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div class="main-page-wrapper home-page-three">
---------
</div>
页脚。php
<?php
/**
* The template for displaying the footer
* Contains the closing of the #content div and all content after.
*/ ?>
</div> <!-- /.html-top-content -->
<footer>
<div class="container-fluid">
-------
</div> <!-- /.container -->
</footer>
<!-- jQuery -->
<script type="text/javascript" src="<?php bloginfo(\'template_url\')?>/assets/js/jquery.2.2.3.min.js"></script>
<script> ---- </script>
--All script files goes here----
</div> <!-- /.main-page-wrapper -->
<?php wp_footer(); ?>
</body>
</html>