---
title: "Tổng hợp code giúp tùy biến footer trong Genesis Framework"
author: "Trung Hiếu"
date: "2015-01-02"
lastmod: "2022-06-19"
url: "https://wpcanban.com/wordpress/thu-thuat-wordpress/tong-hop-code-giup-tuy-bien-footer-trong-genesis.html"
---

# Tổng hợp code giúp tùy biến footer trong Genesis Framework

Tổng hợp code giúp tùy biến footer trong Genesis Framework và Genesis child theme.

![tuy-bien-footer-trong-genesis-framework-va-child-theme](https://wpcanban.com/wp-content/uploads/2015/01/tuy-chinh-footer-trong-genesis-framework.png)

Theo mặc định, phần footer (chân trang) của [*Genesis Framework*](https://wpcanban.com/tag/genesis-framework/) hay *Genesis* child theme chỉ bao gồm textlink của framework (hoặc *child theme*), của [*WordPress*](https://wpcanban.com/category/wordpress) và một liên kết đến trang đăng nhập. Nếu muốn tùy biến footer, cách đơn giản nhất là sử dụng plugin [*Genesis Simple Edits*](https://wpcanban.com/tag/genesis-simple-edits/). Tuy nhiên, nếu bị “dị ứng” với plugin và không muốn cài đặt chúng vì sợ nặng site thì bạn hoàn toàn có thể sử dụng các *code snippets* sau đây để tùy biến phần footer theo ý muốn.

Tham khảo thêm:

- *[Theme Paradise v4.3 và sự lột xác về giao diện quản lý](https://wpcanban.com/thong-bao/theme-paradise-v4-3.html)*
- *[Tùy biến phần copyright trong Genesis Framework và child theme](https://wpcanban.com/wordpress/thu-thuat-wordpress/tuy-bien-phan-copyright-trong-genesis.html)*

## Tùy biến footer trong Genesis

Riêng với theme *[Paradise](https://wpcanban.com/tag/paradise-child-theme/)*, chúng tôi đã tích hợp tính năng cho phép chỉnh sửa footer trong *Genesis* => *Theme Settings* => *Custom Footer Credits*. Các bạn không cần phải sử dụng code bên dưới nữa.

1. Đầu tiên, truy cập thư mục cài đặt *WordPress* thông qua *File Manager* của *cPanel*/ *DirectAdmin* hoặc phần mềm *FTP*, tìm theo đường dẫn */wpcontent/themes/*. Tìm và mở file *functions.php* của *Genesis Framework* hoặc child theme mà bạn đang sử dụng ra.

2. Thêm một trong những đoạn code sau đây vào cuối file *functions.php* và lưu lại.

### Đặt lại vị trí footer

```
//* Đặt lại vị trí footer trong Genesis
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 );
remove_action( 'genesis_footer', 'genesis_do_footer' );
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 );
add_action( 'genesis_after', 'genesis_footer_markup_open', 11 );
add_action( 'genesis_after', 'genesis_do_footer', 12 );
add_action( 'genesis_after', 'genesis_footer_markup_close', 13 );
```

### Tùy biến nút return to top

```
//* Tùy biến nút Return to Top trong Genesis
add_filter( 'genesis_footer_backtotop_text', 'sp_footer_backtotop_text' );
function sp_footer_backtotop_text($backtotop) {
	$backtotop = '[footer_backtotop text="Return to Top"]';
	return $backtotop;
}
```

### Tùy biến credits text hoặc footer text

Bạn có thể sử dụng 1 trong 2 code snippets sau:

```
//* Tùy biến Credits text trong Genesis 1
add_filter( 'genesis_footer_creds_text', 'sp_footer_creds_text' );
function sp_footer_creds_text() {
	echo '<div class="creds"><p>';
	echo 'Copyright &copy; ';
	echo date('Y');
	echo ' &middot; <a href="http://mydomain.com">My Custom Link</a> &middot; Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
	echo '</p></div>';
}
```

Hoặc:

```
//* Tùy biến Footer text trong Genesis
add_filter('genesis_footer_creds_text', 'sp_footer_creds_filter');
function sp_footer_creds_filter( $creds ) {
	$creds = '[footer_copyright] &middot; <a href="http://mydomain.com">My Custom Link</a> &middot; Built on the <a href="http://www.studiopress.com/themes/genesis" title="Genesis Framework">Genesis Framework</a>';
	return $creds;
}
```

### Tùy biến toàn bộ nội dung trong footer

```
//* Tùy biến toàn bộ nội dung Footer trong Genesis
remove_action( 'genesis_footer', 'genesis_do_footer' );
add_action( 'genesis_footer', 'sp_custom_footer' );
function sp_custom_footer() {
	?>
	<p>&copy; Copyright 2012 <a href="http://mydomain.com/">My Domain</a> &middot; All Rights Reserved &middot; Powered by <a href="http://wordpress.org/">WordPress</a> &middot; <a href="http://mydomain.com/wp-admin">Admin</a></p>
	<?php
}
```

Xong. Đơn giản vậy thôi. Chúc các bạn thành công!

Ngoài ra, nếu không muốn can thiệp trực tiếp vào code của theme, các bạn có thể sử dụng plugin *[Genesis Simple Edits](https://wordpress.org/plugins/genesis-simple-edits/)*. Plugin này không chỉ cho phép các bạn tùy chỉnh footer mà cả post info và post meta.

*Nếu bạn thích bài viết này, hãy subscribe blog của tôi để thường xuyên cập nhật những bài viết hay nhất, mới nhất qua email nhé. Cảm ơn rất nhiều.* :)
