Поддержка Проблемы и решения Стоит ли обновлять WordPress

  • Обновил движок до 4.1 и пол сайта пропало. Стоит ли делать это обновление вообще? Что за подстава? У кого нибудь есть сайты на старых движках и как они себя чувствуют?

Просмотр 12 ответов — с 16 по 27 (всего 27)
  • Так ?
    ————-
    /*
    Theme Name: Twenty Ten Child
    Theme URI: http://wordpress.org/
    Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable — make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the «Asides» and «Gallery» categories, and has an optional one-column page template that removes the sidebar.
    Author: the WordPress team
    Version: 1.3
    Template: twentyten

    Version: 0.1.0
    License: GNU General Public License
    License URI: license.txt
    Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu
    */

    @import url(«../twentyten/style.css»);
    ————————————

    Или так? Код:
    ———————————————-
    /*
    Theme Name: Twenty Ten Child
    Description: Дочерняя тема для темы Twenty Ten
    Author: Ваше имя (любое)
    Template: twentyten
    */

    @import url(«URLсайта/twentyten/style.css»);

    ————————————————————

    Вставляем в файл style.css и всё? Остальное не надо?

    Или так?
    ———————————————

    /*
    Theme Name: Twenty Ten Child
    Description: Дочерняя тема для темы Twenty Ten
    Author: Ваше имя (любое)
    Template: twentyten
    */

    @import url(«URLсайта/twentyten/style.css»);

    /*
    Theme Name: Twenty Ten
    Theme URI: http://wordpress.org/
    Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable — make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the «Asides» and «Gallery» categories, and has an optional one-column page template that removes the sidebar.
    Author: the WordPress team
    Version: 1.3
    License: GNU General Public License
    License URI: license.txt
    Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu
    */

    /* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html
    ————————————————————— */

    html, body, div, span, applet, object, iframe,
    h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    a, abbr, acronym, address, big, cite, code,
    del, dfn, em, font, img, ins, kbd, q, s, samp,
    small, strike, strong, sub, sup, tt, var,
    b, u, i, center,
    dl, dt, dd, ol, ul, li,
    fieldset, form, label, legend,
    table, caption, tbody, tfoot, thead, tr, th, td {
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
    }
    body {
    line-height: 1;
    }
    h1, h2, h3, h4, h5, h6 {
    clear: both;
    font-weight: normal;
    }
    ol, ul {
    list-style: none;
    }……………………….. и т.д.
    ———————————————————

    Или так? Вместо:
    ——————————————-
    /*
    Theme Name: Twenty Ten
    Theme URI: http://wordpress.org/
    Description: The 2010 theme for WordPress is stylish, customizable, simple, and readable — make it yours with a custom menu, header image, and background. Twenty Ten supports six widgetized areas (two in the sidebar, four in the footer) and featured images (thumbnails for gallery posts and custom header images for posts and pages). It includes stylesheets for print and the admin Visual Editor, special styles for posts in the «Asides» and «Gallery» categories, and has an optional one-column page template that removes the sidebar.
    Author: the WordPress team
    Version: 1.3
    License: GNU General Public License
    License URI: license.txt
    Tags: black, blue, white, two-columns, fixed-width, custom-header, custom-background, threaded-comments, sticky-post, translation-ready, microformats, rtl-language-support, editor-style, custom-menu
    */

    ——————————————————

    Ставим:
    ———————————————————
    /*
    Theme Name: Twenty Ten Child
    Description: Дочерняя тема для темы Twenty Ten
    Author: Ваше имя (любое)
    Template: twentyten
    */

    @import url(«URLсайта/twentyten/style.css»);

    /* =Reset default browser CSS. Based on work by Eric Meyer: http://meyerweb.com/eric/tools/css/reset/index.html
    ————————————————————— */

    html, body, div, span, applet, object, iframe,
    h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    a, abbr, acronym, address, big, cite, code,
    del, dfn, em, font, img, ins, kbd, q, s, samp,
    small, strike, strong, sub, sup, tt, var,
    b, u, i, center,
    dl, dt, dd, ol, ul, li,
    fieldset, form, label, legend,
    table, caption, tbody, tfoot, thead, tr, th, td {
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
    }
    body {
    line-height: 1;
    }
    h1, h2, h3, h4, h5, h6 {
    clear: both;
    font-weight: normal;
    }
    ol, ul {
    list-style: none;
    }……………………….. и т.д.
    ————————————————

    Опять же, директива @import url(«../twentyten/style.css»); подключает файл стилей родительской темы, а она после обновления будет уже другой?
    Много сказано с одного источника и общими словами, а кто может ответить на мои вопросы?

    Как я понял, нужно создать дубль папки twentyten (со всеми её файлами как есть), назвать её Twenty Ten Child и изменить в ней только файл style.css на тот, который мы обсуждаем, с шапкой:

    /*
    Theme Name: Twenty Ten Child
    Description: Дочерняя тема для темы Twenty Ten
    Template: twentyten

    */

    @import url(«URLсайта/twentyten/style.css»);

    далее…… Всё как есть сейчас

    html, body, div, span, applet, object, iframe,
    h1, h2, h3, h4, h5, h6, p, blockquote, pre,
    a, abbr, acronym, address, big, cite, code,
    del, dfn, em, font, img, ins, kbd, q, s, samp,
    small, strike, strong, sub, sup, tt, var,
    b, u, i, center,
    dl, dt, dd, ol, ul, li,
    fieldset, form, label, legend,
    table, caption, tbody, tfoot, thead, tr, th, td {
    background: transparent;
    border: 0;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
    }
    body {
    line-height: 1;
    }
    h1, h2, h3, h4, h5, h6 {
    clear: both;
    font-weight: normal;
    }
    ol, ul {
    list-style: none;
    }……………………….. и т.д.

    и всё, дело сделано?

    Всё получилось, кроме файла functions.php выдаёт критическую ошибку.

    В отличие от style.css, файл functions.php дочерней темы не заменяет собой соответствующий файл родительской темы. Вместо этого, он загружается в дополнение к родительскому файлу functions.php. (А именно, прямо перед родительским файлом.)
    Как это понимать? Куда конкретно загружается файл functions.php для дочерней темы? Как понимать — прямо перед родительским файлом?
    Загрузил файл functions.php в папку Twenty Ten Child и выдало критическую ошибку. Может в нём надо что-то изменить?

    В тестовом режиме показывает нормально, но при активации дочерней темы выдаёт фатальную ошибку файла functions.php

    Все файлы копировать не нужно. Нужно сделать style.css как вы уже сделали и это все. Остальные файлы копируются по мере необходимости, тогда, когда вы в них делаете изменения. А файл functions.php копировать вообще не нужно, но можно сделать свой и добавлять в него свои функции или переобъявлять в нем плюгальные функции родительской темы (те, которые заключены в конструкцию ‘if ( ! function_exists()’. Это все работает так, что тема сначала ищет подходящий файл или функцию в дочерней теме и если находит, то к родительской уже не обращается и существующие функции не читает в родительской теме, потому что там есть проверка. Внешний вид темы обычно не меняют при обновлении, чтобы не пугать пользователей. Новая стандартная тема никак не влияет на старые.

    «А файл functions.php копировать вообще не нужно, но можно сделать свой и добавлять в него свои функции»
    Я и так делал, создал пустой файл functions.php, вписал туда правила из родительского файла
    <?php
    remove_action( ‘wp_head’, ‘feed_links_extra’, 3 );
    remove_action( ‘wp_head’, ‘feed_links’, 2 );
    remove_action( ‘wp_head’, ‘rsd_link’ );
    remove_action( ‘wp_head’, ‘wlwmanifest_link’ );
    remove_action( ‘wp_head’, ‘index_rel_link’ );
    remove_action( ‘wp_head’, ‘parent_post_rel_link’, 10, 0 );
    remove_action( ‘wp_head’, ‘start_post_rel_link’, 10, 0 );
    remove_action( ‘wp_head’, ‘adjacent_posts_rel_link’, 10, 0 );
    remove_action( ‘wp_head’, ‘wp_generator’ );

    add_shortcode(‘wpbsearch’, ‘get_search_form’);
    ?>

    Показывает фатальную ошибку.

    kartash1701, прочитайте же наконец правила форума.

Просмотр 12 ответов — с 16 по 27 (всего 27)
  • Тема «Стоит ли обновлять WordPress» закрыта для новых ответов.