WordPress主题编辑

如果没有在原来的WordPress的主题触摸是通过修改方式修改了备份(表示为子主题)文件。

  1. 通过结合主题的名称,以方便确定子主题用于创建中的“可湿性粉剂内容/主题”文件夹的新文件夹(例如,如果原来的主题是“twentyfifteen”中的“twentyfifteen胎”创建一个文件夹)
  2. 复制原来的主题和子主题文件夹“主题名称”的“style.css文件”,修改“Themplate”的。
    /*
    Theme Name: Twenty Fifteen Child
    Theme URI: https://wordpress.org/themes/twentyfifteen/
    Template: twentyfifteen
    Author: the WordPress team
    Author URI: https://wordpress.org/
    Description: Our 2015 default theme is clean, blog-focused, and designed for clarity. Twenty Fifteen's simple, straightforward typography is readable on a wide variety of screen sizes, and suitable for multiple languages. We designed it using a mobile-first approach, meaning your content takes center-stage, regardless of whether your visitors arrive by smartphone, tablet, laptop, or desktop computer.
    Version: 1.5
    License: GNU General Public License v2 or later
    License URI: http://www.gnu.org/licenses/gpl-2.0.html
    Tags: black, blue, gray, pink, purple, white, yellow, dark, light, two-columns, left-sidebar, fixed-layout, responsive-layout, accessibility-ready, custom-background, custom-colors, custom-header, custom-menu, editor-style, featured-images, microformats, post-formats, rtl-language-support, sticky-post, threaded-comments, translation-ready
    Text Domain: twentyfifteenTemplate: twntyfifteen
    This theme, like WordPress, is licensed under the GPL.
    Use it to make something cool, have fun, and share what you've learned with others.
    */
    
  3. 创建一个子主题文件夹下面的“的functions.php”的根源。
    <?php
    add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
    function theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    }
    ?>
    
  4. 在原来的主题为“screenshot.png”复制到子主题文件夹。
  5. 从原来的主题文件复制后修改您正在使用编辑子主题文件夹。

(注:http://codex.wordpress.org/Child_Themes)

arrow