当前位置:网站首页>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
边栏推荐
- Syntax basics (variables, input and output, expressions and sequential statements)
- Error: Not a signal or slot declaration
- Hash table lookup (hash table)
- Flink 1.15.1 Cluster Construction (StandaloneSession)
- 数据增强Mixup原理与代码解读
- 剑指offer专项突击版第20天
- dmp(dump)转储文件
- Open Source License Description LGPL
- Talking about data security governance and privacy computing
- 1873. The special bonus calculation
猜你喜欢
随机推荐
Apache DolphinScheduler, a new generation of distributed workflow task scheduling platform in practice - Medium
Syntax basics (variables, input and output, expressions and sequential statements)
Countdown to 2 days|Cloud native Meetup Guangzhou Station, waiting for you!
Everyone in China said data, you need to focus on core characteristic is what?
[C language] Detailed explanation of stacks and queues (define, destroy, and data operations)
Dynamic management of massive service instances
The usage of try...catch and finally in js
北斗三号短报文终端露天矿山高边坡监测方案
Linux下常见的开源数据库,你知道几个?
sql server installation prompts that the username does not exist
Solve the problem of port occupancy Port xxxx was already in use
21天学习挑战赛(2)图解设备树的使用
Likou - preorder traversal, inorder traversal, postorder traversal of binary tree
The 20th day of the special assault version of the sword offer
语法基础(变量、输入输出、表达式与顺序语句)
Principle and Technology of Virtual Memory
【软件测试】自动化测试之unittest框架
QStyle平台风格
Lexicon - the maximum depth of a binary tree
[Fortune-telling-60]: "The Soldier, the Tricky Way"-2-Interpretation of Sun Tzu's Art of War