Thả mã sau vào tệp functions.php của bạn
add_action( 'genesis_entry_content', 'show_full_content', 1 ); function show_full_content() { if( ! is_category() ) //* returning early if it is not a category page return; add_filter( 'genesis_pre_get_option_content_archive', '__return_false' ); //* disabling the excerpt add_filter( 'genesis_pre_get_option_content_archive_limit', '__return_false' ); //* disabling the content limit option }
nếu bạn đang nhắm mục tiêu đến trang danh mục cụ thể thì hãy sử dụng đoạn mã sau:
add_action( 'genesis_entry_content', 'show_full_content', 1 ); function show_full_content() { if( ! is_category( 153 ) ) //* 153 is the category ID. return; add_filter( 'genesis_pre_get_option_content_archive', '__return_false' ); add_filter( 'genesis_pre_get_option_content_archive_limit', '__return_false' ); }
153 là ID danh mục “Plugin” của tôi . Vì vậy, mã chỉ thực thi khi người dùng truy cập trang lưu trữ danh mục “Plugin” của tôi. Kiểm tra liên kết này để biết thêm chi tiết về hàm is_category () của WordPress .