当前位置:网站首页>How to Add Category-Specific Widgets in WordPress
How to Add Category-Specific Widgets in WordPress
2022-08-05 03:05:00 【IDC Industry Observer】
Widgets are definitely a highlight of WordPress.Unfortunately, many users use gadgets without really realizing their true potential, resulting in a cluttered sidebar or two, depending on your theme.
Luckily, there is a solution on your WordPress dashboard in the form of a JetPack module called Widget Visibility.
This little module alone lets you display certain widgets on certain articles or pages -- basically, it gives you fine-grained control over your widgets and where you want them to appear.

With this module activated, there is no limit to the number of "different" sidebars you can have.
You can display certain widgets on your homepage, a different set of widgets on your "About" or "Contact" pages, and a completely different set of widgets on your posts or specific categories.
Let's see how to do it!
Add a specific category of widgets in WordPress
The first thing you need to do is install the JetPack plugin, if you haven't already.
If Jetpack is already installed on your website, then you're ready to go.
First step:
The first thing you need to do is log into your dashboard, mouse over JetPack, and go to settings.
Scroll down until you see Widget Visibility.Click the module name, then click Activate.

Step 2:
Now that you've activated this module, let's see how to display widgets only for certain categories.
Let's say you want to display more articles from that category on an article in the same category.
The easiest way to do this is to first create an image for your category (something simple in Picmonkey will do) and upload the image to your media library.
Then grab the URL of the uploaded image.
Step 3:
Next, go to Appearance > Widgets and drag the Image widget to your sidebar.
Fill in the fields for Image URL and Image Size to ensure it displays correctly.In the "Link URL (when the image is clicked)" field, enter the link of your desired category.
Now, here comes the fun part!
Step 4:
Click the Visibility button and select Display.Change the desired gadget type from the drop-down menu.Then click Save.
The gadget will now only appear on posts belonging to the specified category.
Visibility is controlled by five areas: page type, category, tags, date, and author.
For example, if you want the author widget to only appear on posts by that author, select "Show" from the first drop-down menu and add two rules."The author is" and "The author you want".

Similarly, you can choose to hide certain widgets from certain pages.
Like the author widget example above, you can choose to hide it on your About page, as it really doesn't make sense to have it appear there.In this case, you can change the first option of "Show" to "Hide", then select "Page", and then select the corresponding static page from the final drop-down menu.
Each visibility rule is handled individually.For example, there's no way to only show widgets on posts that are categorized as "recipes" and tagged as "breakfast ideas."You can only choose one or the other.
From https://cn.bluehost.com/blog/wordpress/15915.html
边栏推荐
- Apache DolphinScheduler, a new generation of distributed workflow task scheduling platform in practice - Medium
- 1667. Fix names in tables
- 思考(八十八):使用 protobuf 自定义选项,做数据多版本管理
- How OpenGL works
- 剑指offer专项突击版第20天
- lua learning
- 627. 变更性别
- dmp(dump)转储文件
- 剑指Offer--找出数组中重复的数字(三种解法)
- The pit of std::string::find return value
猜你喜欢

Why did they choose to fall in love with AI?

How Jin Cang database correctness verification platform installation file

Multithreading (2)

【滤波跟踪】基于matlab无迹卡尔曼滤波惯性导航+DVL组合导航【含Matlab源码 2019期】

The Tanabata copywriting you want has been sorted out for you!

dmp(dump)转储文件

OpenGL 工作原理

How OpenGL works

论治理与创新,2022 开放原子全球开源峰会 OpenAnolis 分论坛圆满落幕

Regular expression to match a certain string in the middle
随机推荐
sql server installation prompts that the username does not exist
QT:神奇QVarient
What should I do if the self-incrementing id of online MySQL is exhausted?
[Fortune-telling-60]: "The Soldier, the Tricky Way"-2-Interpretation of Sun Tzu's Art of War
线上MySQL的自增id用尽怎么办?
mysql tree structure query problem
[In-depth study of 4G/5G/6G topic-51]: URLLC-16-"3GPP URLLC related protocols, specifications, and technical principles in-depth interpretation"-11-High reliability technology-2-Link adaptive enhancem
Compressed storage of special matrices
1873. The special bonus calculation
数据增强Mixup原理与代码解读
(11) Metaclass
语法基础(变量、输入输出、表达式与顺序语句)
QT: The Magical QVarient
The design idea of DMicro, the Go microservice development framework
The usage of try...catch and finally in js
How to solve the error cannot update secondary snapshot during a parallel operation when the PostgreSQL database uses navicat to open the table structure?
leetcode - a subtree of another tree
Go 微服务开发框架 DMicro 的设计思路
UOS系统下ksql应用缺少动态库”libtinfo.so.5“问题
1667. 修复表中的名字