首页 > 解决方案 > WordPress中的自定义主题不显示任何内容

问题描述

我已经开始学习 WordPress。我的自定义主题不显示任何内容。以下是代码。

样式.css

/*
Theme Name: My First Theme
Theme URI: http://localhost/wordpress/
Author: Itsmee
Author URI: https://abcd.com
Description: Basic WordPress theme for Sitepoint theme building tutorial
Text Domain: bsimple
Version: 1.0.0
License: GNU General Public License v2 or later
*/

索引.php

<?php
/**
 * The main template file
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 *
 * @package My_First_Theme
 */

get_header();
?>

//content HTML here

<?php get_footer(); ?>

头文件.php

 <?php wp_head(); ?>
    <head>
      <meta charset="utf-8">
      <meta content="width=device-width, initial-scale=1.0" name="viewport">
    
      <title>Bootstrap Template - Index</title>
      <meta content="" name="description">
      <meta content="" name="keywords">
    
      <!-- Favicons -->
      <link href="assets/img/favicon.png" rel="icon">
      <link href="assets/img/apple-touch-icon.png" rel="apple-touch-icon">
    
      <!-- Google Fonts -->
      <link href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,400i,600,700|Raleway:300,400,400i,500,500i,700,800,900" rel="stylesheet">
    
      <!-- Vendor CSS Files -->
      <link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
      <link href="assets/vendor/icofont/icofont.min.css" rel="stylesheet">
      <link href="assets/vendor/animate.css/animate.min.css" rel="stylesheet">
      <link href="assets/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet">
      <link href="assets/vendor/nivo-slider/css/nivo-slider.css" rel="stylesheet">
      <link href="assets/vendor/owl.carousel/assets/owl.carousel.min.css" rel="stylesheet">
      <link href="assets/vendor/venobox/venobox.css" rel="stylesheet">
    
      <!-- Template Main CSS File -->
      <link href="assets/css/style.css" rel="stylesheet">
    
      
    </head>

页脚.php

<?php wp_footer(); ?>
//Footer scripts and other contents

成功创建主题并在后端激活它但是在前端看不到任何东西似乎主题文件没有呈现。

请帮忙!谢谢。

标签: wordpresswordpress-themingcustom-wordpress-pages

解决方案


推荐阅读