Php 从alpha商店主题模板的子主题中删除复制右文本
我已经从alpha商店主题模板创建了一个子主题。我需要删除复制权文本而不修改核心主题Php 从alpha商店主题模板的子主题中删除复制右文本,php,wordpress,Php,Wordpress,我已经从alpha商店主题模板创建了一个子主题。我需要删除复制权文本而不修改核心主题 <?php add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' ); function my_theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
<?php
add_action( 'wp_enqueue_scripts', 'my_theme_enqueue_styles' );
function my_theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
add_action('tha_footer_top', 'your_function');
function your_function() {
$content = '<div class="site-info container"><p>This is inserted at the bottom</p></div>';
echo $content;
}
?>
除非替换子主题中的整个footer.php文件,否则无法从子主题中删除整个元素 不过,您可以做的一件事是使用css在子主题的视图中隐藏元素
add_action('tha_footer_top', 'new_function');
function new_function() {
$content = '<div class="new-text container"><p>This the new text to
be added in</p></div>';
echo $content;
}
然后,您可以使用操作插入自己的文本
例如:
.site-info{
display:none;
}
然后,您可以像这样在子主题的functions.php文件中插入自己的文本
add_action('tha_footer_top', 'new_function');
function new_function() {
$content = '<div class="new-text container"><p>This the new text to
be added in</p></div>';
echo $content;
}
add_action('tha_footer_top','new_function');
函数new_函数(){
$content='将新文本添加到
添加到';
echo$内容;
}
用于停止显示版权声明
add_action( 'wp_head', 'so_45559746_remove_copyright' );
function so_45559746_remove_copyright(){
remove_action( 'tha_footer_top', 'your_function' );
}
用CSS隐藏版权文本 您是否尝试过
remove_action
?我尝试过这个不工作的函数完全删除_页脚($creds){return'>}添加过滤器('alpha-store_footer_creds_text','remove_页脚完全');在这里粘贴网站链接?所以css会帮助你。