Record my commonly used plugins after WordPress installation


My favorite plugins after WordPress installation

1. WordPress installation

The installation process recorded a long time ago, using Docker to build a WordPress blog , recorded the process of installing the version wordpress4.6, which is a bit old. The old version used the UEditor plug-in as the default plug-in for writing articles, but now the markdown plug-in is basically popular, so here The overall steps of the installation process are the same, except that the new version 6.2 is replaced, and the mardown plug-in is replaced at the same time. The basic steps are the same. For other details, see Building a WordPress blog with Docker above.

##下载镜像
docker pull mysql:5.7.36
docker pull wordpress:6.2

##启动
docker run -v /data/wordpressDir/mysqldata:/var/lib/mysql --privileged=true --name wordpress_mysql -e MYSQL_ROOT_PASSWORD=Sendi_2023! -p 13306:3306 -d mysql:5.7.36 --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
docker run -v /data/wordpressDir/www/html:/var/www/html --privileged=true --name wordpress --link wordpress_mysql:mysql -p 8080:80 -d wordpress:6.2

Second, the use of plug-ins

1. Add Astra theme

添加Astra主题then enable
insert image description here

2.Easy Updates Manager

A plug-in that disables automatic updates. In order to prevent Wordpress from being updated randomly, the theme or plug-in that you have set is changed in a mess.
insert image description here
Set directly after installation
找到仪表盘->Updates options进行设置,我是直接全禁用,需要更新的时候再打开,你可以看看其他选项
insert image description here

2.WP Githuber MD

A plug-in that provides full-featured Markdown syntax for WordPress websites, 作者:Terry Linthis WP Githuber MDcan be installed by searching in the plug-in repository
insert image description here
安装后就可以先进行一系列的markdown编写设置了

This plugin comes with built 停用内容修订- in 停用自动储存features.
insert image description here
You can also set 代码高亮, 复制到剪贴板, 图片粘贴, 行号, 主题布景etc.
insert image description here
insert image description here

3.WP-Optimize – Cache, Clean, Compress

Boost your site's speed and performance through caching. Clean the database, compress images and cache your site for higher speed & SEO.
This plug-in 可以清理缓存、数据库修订和草稿记录,优化数据库等is mainly used to clean up revision records and draft records
insert image description here
可以手工清理,也可以自动定动任务清理
insert image description here

4. WP-PostViews或Post Views Counter

文章浏览量计数器(Post Views Counter)orWP-PostViews
insert image description here

5. Easy Table of Contents

Simple directory plugin
insert image description here
Effect:
insert image description here

5. UpdraftPlus Backup/Restore

UpdraftPlus WordPress 备份插件
insert image description here

6.WP Super Cache

缓存插件
insert image description here

7.Media Cleaner

媒体清理插件
insert image description here

8.WP Favorite Posts

收藏插件
insert image description here

8.File Upload Types by WPForms

Upload type plug-in, you can set some files that wordpress does not support by default to upload to the media center
insert image description here

9. Members

Members – Membership & User Role Editor Plugin: Role management plug-in
. By default, wordpress only supports 5 roles. Control through this plug-in supports more and more flexible role control
insert image description here

10. Disable Autosave & Disable Post Revision

禁用修改历史和自动保存插件,你可以试试, since I installed WP Githuber MD, it comes with these two functions, so these two plugins are not installed

11. Disable the auto-draft function

This did not find a ready-made plug-in, so use the online code modification solution
to open wp-admin/includes/post.php and find the following code

$post_id = wp_insert_post(
    array(
        'post_title'  => __( 'Auto Draft' ),
        'post_type'   => $post_type,
        'post_status' => 'auto-draft',
    ),
    false,
    false
);
$post = get_post( $post_id );

The above code first clears the automatic drafts older than seven days, then inserts a new draft, annotates it, and adds the following code:

/* 修改开始*/
global $wpdb;
global $current_user; // 获取当前登录管理用户
$post = $wpdb->get_row( "SELECT * FROM $wpdb->posts WHERE post_status = 'auto-draft' AND post_type = '$post_type' AND post_author = $current_user->ID ORDER BY post_date ASC, ID ASC LIMIT 1" ); // 获取最早一条自动草稿
if ( !$post ) {
    
    
//没有记录添加一条草稿记录
$post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) );
$post = get_post( $post_id );
}
/* 修改结束 */

12. Extra css

Using the Astra theme, the default style text is very large, you need to adjust the style to suit your liking, 外观->自定义->额外cssset it up, and then publish, the following is my own modification, record it for my personal use ( 不一定适合你)

/*全局字体大小14px*/
html{
    
    
	font-size: 14px;
}

/*文章内容的标题h1字体大小*/
h1, .entry-content h1 {
    
    
	font-size: 20px;
}

/*文章内容的标题h2字体大小*/
h2, .entry-content h2 {
    
    
	font-size: 16px;
}

/*文章内容的标题h3字体大小*/
h3, .entry-content h3 {
    
    
	font-size: 14px;
}

/*下边框调整*/
.widget {
    
    
	margin-bottom: 1em;
}

/*引用的样式调整*/
blockquote {
    
    
	display: block;
	padding: 16px;
	margin: 0 0 24px;
	border-left: 8px solid #dddfe4;
	background: #eef0f4;
	overflow: auto;
	word-break: break-	word!important;
}

p {
    
    
	font-size: 16px;
	color: #4d4d4d;
	font-weight: 400;
	line-height: 26px;
	margin: 0 0 16px;
	overflow: hidden;
	overflow-x: auto;
}

/*引用的样式的P标签样式调整*/
blockquote p {
    
    
	font-size: 14px;
	line-height: 22px;
	color: #555666;
	font-weight: 400;
	margin-bottom: 0;
}

.entry-content blockquote p {
    
    
	margin-bottom: 0em;
}

/*代码的样式调整*/
code {
    
    
	color: #c7254e;
	background-color: #f9f2f4;
	border-radius: 2px;
	font-size: 14px;
}

code[class*=language-], pre[class*=language-]{
    
    
	font-size: 12px;
}

.ast-page-builder-template.ast-right-sidebar #secondary {
    
    
	padding-right: 20px;
}

.ast-right-sidebar #secondary {
    
    
	padding-left: 10px;
}

.ast-builder-menu-1 .menu-item.current-menu-item > .menu-link, .ast-builder-menu-1 .inline-on-mobile .menu-item.current-menu-item > .ast-menu-toggle, .ast-builder-menu-1 .current-menu-ancestor > .menu-link {
    
    
	color: #000000;
}

.ast-single-post .entry-content a, .ast-comment-content a:not(.ast-comment-edit-reply-wrap a) {
    
    
	text-decoration: none;
}

/*收藏插件的样式调整*/
.wpfp-span:not(:first-child) {
    
    
	display: none;
}

3. Others

1. Extra modifications within a single article

By using the code to modify, find 外观->主题文件编辑器->文章页面(single.php), add the following label code in the code to customize some effects

		<span style="position: absolute; top: 2em; left: 1.5em;"><?php if(function_exists('the_views')) {
    
     the_views(); } ?>&nbsp;&nbsp;<?php if(function_exists('wpfp_get_post_meta')) {
    
    echo wpfp_get_post_meta(get_the_ID()) ."收藏&nbsp;&nbsp;" ;} ?><?php
if (is_user_logged_in() && function_exists('wpfp_link')) {
    
    
    wpfp_link();
}
?>&nbsp;&nbsp;分类:<?php the_category(','); ?>&nbsp;&nbsp;<?php the_tags(); ?></span>

insert image description here

Effects such as:
insert image description here

2. Solution to media upload file type limitation

修改wp-config.php文件,在其中增加一行语句:

define( 'ALLOW_UNFILTERED_UPLOADS', true );

以上的是全局开放所有文件格式可以上传的方法,只开放部分的没有测试出来

Guess you like

Origin blog.csdn.net/jxlhljh/article/details/131861658