WordPress дочерняя тема не перезаписывает изменения - PullRequest
0 голосов
/ 29 августа 2018

У меня есть две темы в моей установке WordPress, theme1 и theme1-child (установлено как активное).

Есть часть theme1, которую я хочу отредактировать, theme1/inc/templates/post-meta.php

if ( ! function_exists( 'theme1_entry_date' ) ) :
function theme1_entry_date( $echo = true ) {
    if ( has_post_format( array( 'chat', 'status' ) ) )
        $format_prefix = _x( '%1$s on %2$s', '1: post format name. 2: date', 'theme1' );
    else
        $format_prefix = '%2$s';


    $date = sprintf( __( ' on ', 'theme1' ) . '<a href="%1$s" title="%2$s" rel="bookmark"><time class="entry-date" datetime="%3$s">%4$s</time></a>',
        esc_url( get_permalink() ),
        esc_attr( sprintf( __( 'Permalink to %s', 'theme1' ), the_title_attribute( 'echo=0' ) ) ),
        esc_attr( get_the_date( 'c' ) ),
        esc_html( sprintf( $format_prefix, get_post_format_string( get_post_format() ), get_the_date() ) )
    );

    if ( $echo )
        echo $date;

    return $date;
}
endif;

style.css

/*
Theme Name: Theme1 Child
Theme URI: http://www.url.com
Description: This is a child theme for Theme1.
Author: Author
Author URI: http: //www.url.com
Template: theme1
Version: 1.0
*/

@import url("../theme1/style.css");

div.woocommerce-tabs ul.tabs{display:none !important;}
html body .resp-tabs-container {margin-bottom: 30px;}
@media screen and (min-width: 800px) {
    html body div.resp-tab-content {
        padding: 10px !important;
    }
}

Итак, я заново создал этот файл с поправками в: theme1-child/inc/templates/post-meta.php, но поправки не отображаются.

Есть идеи, почему это не подхватывает изменения?

Ответы [ 2 ]

0 голосов
/ 29 августа 2018

Вам нужно вставить theme1_entry_date function в вашу дочернюю тему functions.php файл.

Спасибо

0 голосов
/ 29 августа 2018

Возможно, у вас есть ошибки в файле style.css, помещенном в дочерний шаблон?

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...