是否要在 WordPress 网站上显示注册用户的数量? 查看注册用户的数量有助于鼓励其他访问者注册。 既然陈述这样的事实证明其他游客已经注册了,为什么游客必须是一个奇怪的人? 它几乎与同龄人的压力相似,而且非常有效。
查看此统计信息还有助于显示您的网站在不断增长。 忠实的访客定期检查,你会看到这个统计数据增长,这是伟大的看到他们,但请记住,它的工作原理两种方式,他们可以看到下降以及。 今天,我将向您展示如何使用两种方法查看 WordPress 的注册用户数。
如何处理 WordPress 统计信息
显示增长和受欢迎程度绝非坏事,大多数网站在出现任何可能性时都会夸耀这些统计数据。 但是,需要注意的是,统计数据可以指示增长,但也可能表示下降。 当这种情况发生时,一般的想法是试图隐藏或删除统计数据,但这实际上可能会伤害你更多,因为你实际上表明,你不确定衰退最终会停止。
如果你决定向世界展示统计数据,不要停止。 无论您的网站有多大或多么小,您的网站统计数据对每个人都很重要。 这包括访客和合作伙伴。
如何查看 WordPress 中的注册用户数
今天,我将向您展示如何使用两种方法查看 WordPress 的注册用户数。 第一种方法是 简单的博客统计 插件。 这是一个非常容易使用的插件,这个过程非常快。 第二种方法是使用代码手动显示注册用户的数量。 请记住,使用代码始终是向网站添加功能的更有效的方法,因为所有插件都会减慢您的网站速度。
方法 1:安装简单的博客统计信息
转到 WordPress 插件区域,然后单击[新規追加]让我们从单击选项开始。
在可用的搜索框中搜索简单的博客统计信息。 这将向上拉其他插件,这些插件可能很有用。
向下滚动,直到找到一个简单的博客统计插件,[今すぐインストール]单击该按钮以激活插件。
在左侧的管理面板中,单击[設定],然后单击[簡単なブログ統計]选择一个选项。 这将上拉主设置页。
使用简单的博客统计信息
此插件是 短代码 以查看网站上的特定统计信息。 这些短代码可以是任何页面、帖子或 文本小部件 到您的网站。 在“设置”页上,选择[ショートコード]单击该部分。
这将显示可用于此插件的所有短代码。 您可以共享各种统计信息,例如 员额总数、页面、帖子类型等。 查找用户数的短代码并复制短代码。 [sbs_users}. Simply paste the shortcode wherever you want to display the number of users on your website.
Congratulations, you have successfully displayed the number of users on your website.
Method 2: Coding Approach
This approach will have the same result of the plugin but will require a simple code edit.
Let’s start by logging into the cPanel and clicking on the File Manager option. The File Manager will allow you to access all of the files related to your website.
You need to locate your theme’s functions.php file. Click on the public_html directory, then click on the wp-content folder. Inside of this folder, you will find all of the content related to your website. Click on the themes folder and enter the folder of the theme you are currently using. Finally, right-click on the functions.php file and select the Edit option.
A pop-up window will show up. This box will warn you to create a backup of your files before editing anything. This will ensure that you can revert your website back to when it was working if something goes wrong. Click on the “Edit” button. A new tab will open containing all of the code from the file.
Simply copy and paste the following lines of code into your functions.php file:[ht_message mstyle=”info” title=”” show_icon=”” id=”” class=”” style=”” ]函数 users_number() |
$usercount = count_users();
$result = $usercount[‘total_users’];
返回$result。
}
add_shortcode(‘number_of_users’, ‘users_number’);[/ht_message]
这将创建短代码 [number_of_users] 它可用于在您的网站上显示用户数。 将代码插入到函数.php文件中后,[変更の保存]单击该按钮退出。
恭喜你,你成功地在您的网站上增加了一些用户,而无需使用插件。 如果要删除此代码,请从函数.php文件中删除它。
分享所有积极的统计数据,你可以
如果你看看主要的网站和公司,你会发现所有的积极事实都在宣传。 显示良好的统计数据有助于改善您的网站图像,更好的图像将帮助您传播信息,这意味着您的访问者。 这是证明一切进展顺利的好方法,但我们需要能够解释为什么和如何统计数据不工作,扭转局面。
你选择使用哪种方法? 你选择的方法容易遵循吗?