Build Your Own WebsiteHow to attract followers to your official account after building a website? Forcing users to follow the official account and reply to view content is a very effective method for diverting traffic to the official account. This article recommends 4 methods that require following the official account to view website content.
Usage method:
Method 1: Plugin Version for Official Account Traffic Diversion
For regular users, using the plugin version is the most convenient and quickest method. The plugin shared here is "Official Account Follower Growth". "The Official Account Follower Growth Plugin can hide any part of the article content. When visitors follow your WeChat official account, they can obtain a verification code to view the hidden content. The frontend demonstration effect is as shown in the figure below:
Usage method:- Download Plugin Installation Package
- Upload and install the plugin via the WP Admin Dashboard, and activate it.
- Configure official account information in the plugin's backend settings.
- Add automatic reply keywords in the WeChat Official Account backend.
Method 2: Code Version for Official Account Traffic Diversion
1. The code version method is similar to the plugin version. Copy the code below and paste it into theWordPress Themefunctions.php file. Note to modify the QR code image address, name, and other content in the code below./**
* wordpress微信公众号吸粉的3种方法
* https://blog.naibabiji.com/skill/weixin-guan-zhu-ke-jian.html
*/
function lxtx_secret_content($atts, $content=null){
extract(shortcode_atts(array('key'=>null,'keyword'=>null), $atts));
if(isset($_POST['secret_key']) && $_POST['secret_key']==$key){
return ''.$content.'';
} else {
return
'
此处内容已经被作者无情的隐藏,请输入验证码查看内容
请关注“你的名字”官方QQ公众号,回复关键字“'.$keyword.'”,获取验证码。【注】用手机QQ扫描右侧二维码都可以关注“你的名字”官方QQ公众号。
';
}
}
add_shortcode('gzh2v', 'lxtx_secret_content');2. Add the code below to the theme's style.css file..post_hide_box, .secret-password{background: none repeat scroll 0 0 #efe;border-left: 5px solid #e74c3c;color: #555;padding: 10px 0 10px 10px;border-radius: 5px;margin-bottom: 15px;overflow:hidden; clear:both;}
.post_hide_box .post-secret{font-size: 18px; line-height:20px; color:#e74c3c; margin:5px;}
.post_hide_box form{ margin:15px 0;}
.post_hide_box form span{ font-size:18px; font-weight:700;}
.post_hide_box .erweima{ margin-left:20px; margin-right:16px;}
.post_hide_box input[type=password]{ color: #9ba1a8; padding: 6px; background-color: #f6f6f6; border: 1px solid #e4e6e8; font-size: 12px;-moz-transition: border .25s linear,color .25s linear,background-color .25s linear; -webkit-transition: border .25s linear,color .25s linear,background-color .25s linear; -o-transition: border .25s linear,color .25s linear,background-color .25s linear; transition: border .25s linear,color .25s linear,background-color .25s linear;}
.post_hide_box input[type=submit] { background: #F88C00; border: none; border: 2px solid;border-color: #F88C00; border-left: none; border-top: none; padding: 0px;width: 100px; height: 38px; color: #fff; outline: 0;border-radius: 0 0 2px 0; font-size: 16px;}
.post_hide_box .details span{color:#e74c3c;}3. Add the shortcode. When writing articles, you can directly insert the shortcode into articles where content requires following the official account to be visible.// 后台文本编辑框中添加公众号隐藏简码按钮
function lxtx_wpsites_add_gzh_quicktags() {
if (wp_script_is('quicktags')){
?>
The shortcode when publishing an article is as follows:[gzh2v keyword="关键字" key="验证码"]隐藏内容[/gzh2v]
Method 3: Service Requiring Follow to Read Full Article
This method is somewhat different from the previous two. It only hides part of the article content on the frontend through CSS code, but the full content can be seen in the source code, which does not affectwebsite SEOeffectiveness.
If you want to implement this method yourself using code, you can refer tothis article, but the author did not provide the complete code, only the idea. Therefore, novice users can use third-party services. Naibabiji recommends the service fromhttps://openwrite.cn/. Register an account on their website, then you can see the self-media follower growth tool in the tools section. After adding information, add the code to your website's theme files.
Method 4: Laobuluo WeChat Verification Plugin
Plugin Download: http://tools.laobuluo.com/wordpress/plugins/cnwper-weixin.zip We can configure the plugin settings. 1. Developer TOKEN If we are not using the official account API interface, then fill in anything here. It is recommended not to use the API, otherwise it may invalidate other preset automatic reply keywords. 2. Official Account URL This is the QR code image of the official account we need to display on the frontend. The size should be appropriate. 3. Verification Code Retrieval Keyword This should correspond to the automatic reply keyword preset in the WeChat Official Account backend. 4. Verification Code Validity Period Generally set to 2 minutes. The unit is default. 5. Interface File Name This is the PHP file that will be generated in our website's root directory, corresponding to the return URL to be set in the automatic reply. 6. Reply Template This is generally default, but can be fine-tuned as needed. Then set up automatic replies in the official account.查看验证码
Publication Address https://www.itbulu.com/weixin-saoma.htmlReference: 
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.