Hugh's Blog

Yii2 在 Nginx 下的配置

这些都是 Yii2 在 Nginx 的一些基础配置,做个记录 (WNMP 环境,Linux 下类似) 直接在配置文件里添加 (自定义域名: example.com) # Yii2 server { listen 80; server_name example.com www.example.com; # Linux下需要绝对 ...

 

Windows 搭建 WNMP 环境

最近安装 Ubuntu 都是一卡一卡的,决定还是回到 Windows 的怀抱了 建立环境目录并下载 Nginx: D:\wnmp\nginx PHP: D:\wnmp\php7 MySQL: D:\wnmp\mysql PHP 通过 FastCGI 来执行,所以选择 Non Thread Safe 的版本就行,下载好之后解压到相应 ...

 

Ubuntu 1604 搭建 LNMP 环境

每次重装系统都要搭建 LNMP 环境,作个记录 (Ubuntu 1604) 安装 Nginx sudo apt-get update sudo apt-get install nginx 安装完之后访问 localhost,看到 Welcome 的信息说明安装成功 安装 MySQL sudo apt-get install mysql-server 过程中会 ...

WordPress 修改 tinyMCE 设置

今天在 WordPress 中使用默认的编辑器修改文章内容,在切换代码模式中发现编辑器会把 span 标签给过滤掉,而我需要保留 span 标签,Google 之后发现原来可以在 functions 中 ...

WordPress 为文章分类添加图片

为文章分类添加图片字段 /** * Add image for category */ add_action('init', 'my_category_module'); function my_category_module() { $taxonomy = 'category'; add_action($taxonomy . '_add_form_fields', 'add_custom_field_for_taxonomy'); add_action($taxonomy . '_edit_form_fields', 'add_custom_field_for_taxonomy'); add_action('create_' . $taxonomy, 'save_custom_field_for_taxonomy'); add_action('edited_' . $taxonomy, 'save_custom_field_for_taxonomy'); } function add_custom_field_for_taxonomy($tag) { $category_images = get_option('category_images'); $category_image = ''; if (is_array($category_images) && array_key_exists($tag->term_id, $category_images)) { $category_image = $category_images[$tag->term_id]; } echo '<tr><th scope="row" valign="top"><label for="auteur_revue_image">Image</label></th><td>'; if ($category_image != ...

 
<< Newer Posts Older Posts >>