当前位置:网站首页>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
边栏推荐
- 1527. 患某种疾病的患者
- Programmer's Tanabata Romantic Moment
- Everyone in China said data, you need to focus on core characteristic is what?
- 引领数字医学高地,中山医院探索打造未来医院“新范式”
- 冒泡排序与快速排序
- 从“能用”到“好用” 国产软件自主可控持续推进
- Access Characteristics of Constructor under Inheritance Relationship
- Matlab画图3
- 如何在WordPress中添加特定类别的小工具
- Question about #sql shell#, how to solve it?
猜你喜欢
![[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)](/img/7b/8b3f1e4f0000aa34fc1f8fff485765.png)
[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)

冒泡排序与快速排序

你要的七夕文案,已为您整理好!

Step by step how to perform data risk assessment

2022-08-04: Input: deduplicated array arr, the numbers in it only contain 0~9.limit, a number.Return: The maximum number that can be spelled out with arr if the requirement is smaller than limit.from

In 2022, you still can't "low code"?Data science can also play with Low-Code!

龙蜥社区第二届理事大会圆满召开!理事换届选举、4 位特约顾问加入

The usage of try...catch and finally in js

告白数字化转型时代,时速云镌刻价值新起点

如何在WordPress中添加特定类别的小工具
随机推荐
Chinese characters to Pinyin
torch.roll()
使用二维码传输文件的小工具 - QFileTrans 1.2.0.1
word分栏小记
毕设-基于SSM房屋租赁管理系统
lua learning
1527. Patients suffering from a disease
1484. Sell Products by Date
J9 Digital Currency: What is the creator economy of web3?
dmp(dump)转储文件
Flink 1.15.1 Cluster Construction (StandaloneSession)
Apache DolphinScheduler, a new generation of distributed workflow task scheduling platform in practice - Medium
Cybersecurity and the Metaverse: Identifying Weak Links
Countdown to 2 days|Cloud native Meetup Guangzhou Station, waiting for you!
Data storage practice based on left-order traversal
百日刷题计划 ———— DAY2
【七夕节】浪漫七夕,代码传情。将爱意变成绚烂的立体场景,给她(他)一个惊喜!(送代码)
mysql没法Execute 大拿们求解
程序员的七夕浪漫时刻
The usage of try...catch and finally in js