Category

Widget

wordpress-tags-cloud-widget-limit

How to show limit number of Tags Displayed by WordPress tags cloud

By | Widget | No Comments

The Tag Cloud widget is a useful widget which displays a cloud of your most used tags on the sidebar or other areas that support widgets on websites powered by WordPress. But when the number of tags used grows, the list output by Tag Cloud widget may simply become too long or too short to your liking.

The default Tag Cloud widget does not support limiting or increasing the tags count.

Unfortunately, Tag Cloud widget does not provide any way to customize or set the number of tags to show in the output. To control the number of tags displayed by Tag Cloud widget, insert the following code snippet in your active theme’sfunctions.php custom functions file.

[[code]]czozMDY6XCINCmFkZF9maWx0ZXIoIFwnd2lkZ2V0X3RhZ19jbG91ZF9hcmdzXCcsIFwndGpfdGFnX2Nsb3VkX2xpbWl0XCcgKTsNCmZ1bmN0e1smKiZdfWlvbiB0al90YWdfY2xvdWRfbGltaXQoJGFyZ3MpeyANCgkvLyBDaGVjayBpZiB0YXhvbm9teSBvcHRpb24gb2YgdGhlIHdpZGdldCB7WyYqJl19aXMgc2V0IHRvIHRhZ3MNCglpZiAoIGlzc2V0KCRhcmdzW1wndGF4b25vbXlcJ10pICYmICRhcmdzW1wndGF4b25vbXlcJ10gPT0gXCdwb3N0e1smKiZdfV90YWdcJyApew0KCQkkYXJnc1tcJ251bWJlclwnXSA9IDIwOyAvLyBOdW1iZXIgb2YgdGFncyB0byBzaG93DQogCX0NCglyZXR1cm4gJGF7WyYqJl19cmdzOw0KfQ0KXCI7e1smKiZdfQ==[[/code]]
 

Replace the number of tags to display with your own desired count. Example above shows 25 tags. By default, WordPress limits the terms shown to 45 most used tags. You can increase (add) or decrease (reduce) the number of tags shown as you like.

On the other hand, if you use custom taxonomies and want to display those instead, replace the post_tag (the default WordPress taxonomy for tags) in the above code with the custom taxonomy term.

WordPress Exclude Categories from Recent Posts Widget

By | Widget | No Comments

Today I had to find a way to exclude posts from certain categories from showing up in the recent posts widget. I did a search and I stumbled across this discussion in the WordPress Forums.

I have found that pretty much everything you need with WordPress has been discussed and solved somewhere out in the Interwebs. Thankfully lawless shared his solution to this need. By adding the following code to your functions.php file, you can exclude categories by adding the category ID to the new Exclude Category(s) field.You can copy his code below and paste it into your functions.php file. I also packaged it up as a plugin which you can download and install manually. I will work on adding it to the WordPress repository shortly.

 

exclude-category-recent-posts

 

nhantam
VLandingPage

Freelancer Wordpess Developer Team