2017-08-08 61 views
2

我已經從alpha-store主題模板創建了一個兒童主題。我需要刪除複製右側的文本,而無需修改核心主題刪除從alpha-store主題模板的兒童主題複製權利文本

<?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; 
} 
?> 
+0

你嘗試過'remove_action'嗎? – RRikesh

+0

我試過這個,不工作function remove_the_footer_entirely($ creds){ return''; } add_filter('alpha-store_footer_creds_text','remove_the_footer_entirely'); –

+0

粘貼網站鏈接在這裏?所以CSS會幫助你。 –

回答

1

,除非你更換了孩子的整個footer.php文件無法刪除從子主題整個元素。

你可以做的一件事就是使用CSS隱藏子視圖中的元素。

然後,您可以使用該操作插入自己的文本。

例如:

.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; 
}