编辑配置文件:vi /etc/my.cnf,在[mysqld]下面添加lower_case_table_names=1, 保存后,重启mariadb即可。 重启mariadb: systemctl restart mariadb
编程
nginx https配置模板
server { listen 443 ssl http2 default_server; server_name dev.wujie.me; root /var/www/dev.wujie.me; index index.html index.htm index.php; #文件上传大小限制 必须要放在server...
Nginx PHP 配置模板
server { listen 80; root /var/www/www.example.com; # Add index.php to the list if you are using PHP index index.html index.htm index.php index.nginx-debian.html; server_name w...
wordpress之WP_Query函数
用法一、查询某一分类下的文章,代码如下: <?php $query = new WP_Query([ 'post_type' => 'product', // 文章类型是自定义类型 product 'posts_per_page' => 999, // 每页 999 条 ...
wordpress之wp_list_categories函数
该函数用来输出一个某个分类法下的分类列表,输出的是html格式,默认是 <li>...</li> $term = get_term_by('slug', 'software', 'product_category'); wp_list_categories([ 'taxonomy' ...
wordpress之the_xxx 系列的函数
该系列函数主要用于对单篇文章使用,获取单篇文章的相关信息,常用函数如下: 输出文章标题 <?php the_title() ?> 输出文章发布时间 <?php echo get_the_date( 'Y-m-d' ); ?> 输出文...
wordpress之sanitize_text_field函数
清理用户输入或者从数据库中获取的字符串。 检查是否合法的 UTF-8 字符,将 < 转换成 HTML 实体,去掉所有标签,删除所有换行符,占位符,以及额外的空格,去掉八位字节。 常用于后台meta box 保存内容...
wordpress函数之get_the_terms
该函数用于在已知文章ID和分类法的时候调用,常用于文章详情页面。用来获取分类信息 用法: /** 第一个参数表是当前文章的ID, 第二个参数表示所属的分类法,即taxonomy name。 在single页面时可以直接使...
wordpress函数之get_term_by
该函数用来获取一个分类的信息,实际是 wp_terms 和 wp_term_taxonomy 表的联合查询 第一个参数表示根据 wp_terms 表的哪个字段查询 第二个参数表示该字段的值 第三个参数表示分类法的名称,即 wp_term...
wordpress中和category页面有关的函数
获取当前分类的分类名称 <?php single_cat_title() ?> 获取当前分类的slug <?php $term = get_queried_object(); echo $term->slug;
