当前位置:网站首页>初学者入门:使用WordPress搭建一个专属自己的博客
初学者入门:使用WordPress搭建一个专属自己的博客
2022-07-27 12:49:00 【InfoQ】
体验简介
背景知识
- 云服务器 ECS
- Wordpress
连接 ECS 服务器
安装 WordPress 中文版
wget https://cn.wordpress.org/latest-zh_CN.tar.gz
tar -zxvf latest-zh_CN.tar.gz
mkdir /var/www/html/wp-blog
mv wordpress/* /var/www/html/wp-blog/
cat -n /var/www/html/wp-blog/wp-config-sample.php
# 进入WordPress目录
cd /var/www/html/wp-blog/
# 复制模板文件为配置文件
cp wp-config-sample.php wp-config.php
# database_name_here为数据库名称
sed -i 's/database_name_here/wordpress/' /var/www/html/wp-blog/wp-config.php
# username_here为数据库的用户名
sed -i 's/username_here/root/' /var/www/html/wp-blog/wp-config.php
# password_here为数据库的登录密码
sed -i 's/password_here/NewPassWord1./' /var/www/html/wp-blog/wp-config.php
systemctl start httpd

自定义站点主题

# 首先进入WordPress主题目录
cd /var/www/html/wp-blog/wp-content/themes/
# 使用wget命令下载上一步选择的主题
wget https://downloads.wordpress.org/theme/markiter.1.5.zip
# 使用unzip命令解压安装包
unzip markiter.1.5.zip
# 查看所有主题
ll

添加自定义小组件
vim /var/www/html/wp-blog/wp-content/themes/markiter/footer.php
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/L2Dwidget.min.js"></script>
<script type="text/javascript">
L2Dwidget.init();
</script>

安装 MarkDown 插件
cd /var/www/html/wp-blog/wp-content/plugins/
wget https://downloads.wordpress.org/plugin/wp-editormd.10.1.2.zip
unzip wp-editormd.10.1.2.zip

最终实现的效果
- 博客首页

- 博客编辑页面

边栏推荐
- Can you tell me the difference between lateinit and lazy in kotlin?
- 固定定位
- Connotative quotations
- Perfect guide | how to use ODBC for agent free Oracle database monitoring?
- "Game engine light in light out" 4.1 unity shader and OpenGL shader
- Background and framework introduction and basic environment preparation of hucang integrated e-commerce project
- B站713故障后的多活容灾建设|TakinTalks大咖分享
- 【VSCode】SyntaxError: Cannot use import statement outside a module
- Overview of static inner classes and non static inner classes
- clear
猜你喜欢

面试考点:三种图的问题

Background and framework introduction and basic environment preparation of hucang integrated e-commerce project

湖仓一体电商项目背景与架构介绍及基础环境准备

CVPR22 | 关系意识的图神经架构搜索

B站713故障后的多活容灾建设|TakinTalks大咖分享

如何调试JNI程序

Overview of static inner classes and non static inner classes

v-text

GAN:生成对抗网络 Generative Adversarial Networks

马斯克被曝绿了谷歌创始人:导致挚友二婚破裂,曾下跪求原谅
随机推荐
高度塌陷最终解决方案(无副作用)
How to debug JNI program
flinksql从Oracle同步数据到Doris,一共50几个字段,Oracle表中3000多万条
7-16 daily sword finger offer II 041. Average value of sliding window
Seata 在蚂蚁国际银行业务的落地实践
Poj1273 drainage ditches [maximum flow] [SAP]
爱可可AI前沿推介(7.27)
Xshell7 can log in to MySQL virtual machine, but not mysql
Wfuzz, a test tool that can blur everything that can be blurred
Feign's overall process
v-on基础指令
Do you really understand CMS garbage collector?
JNI程序如何进行参数传递
Will saffron become a safe and effective natural therapy for patients with arthritis?
Relative positioning
Do you really understand CMS garbage collector?
18. Text processing tool -grep
改变线程状态的方法
Can you tell me the difference between lateinit and lazy in kotlin?
Interview site: three kinds of questions