Trong bài này mình sẽ hướng dẫn các bạn tùy biến nội dung copyright credit nằm ở footer của genesis child theme. Điều này thật có ý nghĩa đối với những bạn thích cái ta cho website mình thay vi dòng copyright của genesis.
Bạn mở functions.php của child theme ra, thêm đoạn code này vào và save lại:
//* Do NOT include the opening php tag
//* Customize the credits
add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' );
function sp_footer_creds_text()
echo '<div class="creds"><p>';
echo 'Copyright © ';
echo date('Y');
echo ' · <a href="http://mydomain.com">My Custom Link</a> · Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
echo '</p></div>';
Kết quả phần footer đã đổi thành thế này:
Mặc định thông tin copyright widget nằm ở bên góc phải của footer. Bạn thay đổi nội dung credit phù hợp với yêu cầu của bạn. Genesis Footer cũng cung cấp các shortcode cho bạn tạo nội dung footer của mình. Thay dòng “Copyright ©” ở trên bằng shortcode [ footer_copyright ] như dưới đây.
//* Do NOT include the opening php tag
//* Change the footer text
add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
function sp_footer_creds_filter( $creds )
$creds = '[footer_copyright] · <a href="http://mydomain.com">My Custom Link</a> · Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
return $creds;
Chú ý: nếu bạn copy shortcode trong bài thì bỏ dấu cách đi nhé.
Bạn cũng có thể sửa toàn bộ nội dung có trong footer, bao gồm nút back to top.
//* Do NOT include the opening php tag
//* Customize the entire footer
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'sp_custom_footer' );
function sp_custom_footer()
?>
<p>© Copyright 2012 <a href="http://hoangweb.com/">HoangWeb.COM</a> · All Rights Reserved · Powered by <a href="http://wordpress.org/">WordPress</a> · <a href="http://khosachnoi.net">KhoSachNoi.NET</a></p>
<?php
Xóa Genesis Copyright Footer Credit
Để thực hiện điều này, bạn sẽ xóa vùng footer area trong genesis child theme. Cũng sử dụng đoạn code này trong file functions.php nhé.
remove_action( 'genesis_footer', 'genesis_do_footer' );
OK. Vậy là xong. Nếu không làm được thì comment bên dưới nhá!
Tùy chỉnh Copyright Footer Credit trong Genesis Theme
0 nhận xét:
Đăng nhận xét