WAIMAOZHAN - 2024 - 3
type: channel
link: https://waimaozhan.cn/2024/03/
description: Your description here.
items: Wordpress custom post type in archive list
items: Wordpress rewrite rules for nginx server
items: How to clean msyql binary logs

Wordpress custom post type in archive list
type: item
date: 2024-03-11T14:47:54+08:00
description: //show custom post type in archives. function ns_set_archive_post_types($query){ // We cannot use 'is_archive' here because post type archives should not be included $is_target_query = !is_admin() && $query->is_main_query() && ($query->is_date || $query->is_author || $query->is_category || $query->is_tag || $query->is_tax); if($is_target_query){ $target_types = array('post', 'ns_book_cpt'); $query->set('post_type', $target_types); } } add_action('pre_get_posts', 'ns_set_archive_post_types', 10, 1); ref:https://www.rafaelcardero.com/courses/post-types-in-wordpress/l/109/

Wordpress rewrite rules for nginx server
type: item
date: 2024-03-08T16:27:00+08:00
description: location / { try_files $uri $uri/ /index.php?$args; } rewrite /wp-admin$ $scheme://$host$uri/ permanent;

How to clean msyql binary logs
type: item
date: 2024-03-08T15:20:00+08:00
description: First, use`SHOW BINARY LOGS;SHOW MASTER LOGS;`to find the binlog name, then use the magic quote as belowHere is the magicpurge binary logs to 'mysql-bin.****'; * is the name of latest binary log file.This is safe and quick, and can get more free space.