Php WordPress子主题不覆盖更改
我的WordPress安装中有两个主题,主题1和子主题1设置为活动 我想编辑theme1的一部分,theme1/inc/templates/post-meta.php 因此,我在theme1 child/inc/templates/post-meta.php中重新创建了这个文件,并对其进行了修改,但是没有显示这些修改Php WordPress子主题不覆盖更改,php,wordpress,wordpress-theming,Php,Wordpress,Wordpress Theming,我的WordPress安装中有两个主题,主题1和子主题1设置为活动 我想编辑theme1的一部分,theme1/inc/templates/post-meta.php 因此,我在theme1 child/inc/templates/post-meta.php中重新创建了这个文件,并对其进行了修改,但是没有显示这些修改 有什么办法解释为什么这样做不起作用吗?也许您在子模板中放置的style.css文件中有bug 您需要将theme1\u entry\u date函数粘贴到您的子theme func
有什么办法解释为什么这样做不起作用吗?也许您在子模板中放置的style.css文件中有bug 您需要将theme1\u entry\u date函数粘贴到您的子theme functions.php文件中
谢谢它只是空白,我只想做这一个改变。functions.php和style.css都是空的。请参阅-您必须创建具有特定内容的style.css。我已经完成了,而且它似乎可以工作,因此我应该将所有更改添加到functions.php,并删除post meta.php?如果您想覆盖父主题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;
/*
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;
}
}