Custom Widget for special Pages


Hi Beans lover,

I'm new with wordpress and have few questions about this amazing framework πŸ™‚

I tried Gantry 5 and Warp before and I know how to control the widgets for special pages. However, with Beans I dont know how to control the widget like Gantry and Warp.

For example, I need to create a slideshow (with widget PROMO) below the Menu and I want to display this widget (promo slideshow) for HOME Page Only.

For contact page, I want to to use the same promo widget position but for google map plugin with fullwidth. The slideshow from homepage should be invisible from contact page. Could you please advice?

One more, I want to create a custom page without content, just show widgets only. Could you please help?

Thank you


Hey Tony, welcome to Beans.

One thing about WordPress Core is that it doesn't have anyway to control widgets on a per page basis. It is an area that I personally feel WordPress could improve, as I mentionned in this interview πŸ™‚

That said, widgets are meant to be small utility blocks used to display links, search field etc. rather than to display lots of content, sliders and what not. In other words, pages are not meant to be built with widgets. This has gone horribly wrong in a lot of themes which end up being a bunch of widgets put together. Not only it is hacky, it is also bad performance wise.

The best solution would indeed be to build a custom page template to display your slider from a post type (with no plugin :-)). If you are interested in that, I am happy to help you with it.

Alternatively, we could dictate which widget (depending on how they are built) to display on your home and contact pages via your child theme. If you want to go for that, please advise which plugin/widget your are using so that I can look into it.

Thanks,


Hi Thierry,

I see your point, great interview πŸ™‚

"What new features would you like to see in upcoming versions of WordPress? The ability to assigning sidebars and widgets on a per page/post basis. The way WordPress currently handles it isn’t flexible enough and we often see themes and plugins registering a ridiculous amount of widget areas (sidebars) to try and solve this issue which is definitely not the best way to deal with it."

Edited: I will try another solution from wp community.


Great Tony, please don't hesitate to ask if you need help, I will gladly assit πŸ™‚ Feel free to post and update with your solution which might also help others.

Thanks,


For assigning widgets per page/post etc I use the plugin Content Aware Sidebar plugin. I have a tutorial for it here: http://easywebdesigntutorials.com/custom-widget-per-page-or-post-using-content-aware-sidebar-plugin/

ps I totally agree on having a way in WordPress core on assigning widgets per page/post. I found an old trac ticket https://core.trac.wordpress.org/ticket/4280 but it looks abadoned. I will see if I can bring it up during one of the developer chats in https://wordpress.slack.com/messages/core/


I tested several plugins for this, and found that the free plugin called Widget Logic does the job well. It leaves a very small code footprint and it allows the user to apply WP conditional tags to determine where a particular widget will show .

Which is both the good and the bad thing about this plugin. On one hand, it allows a really granular control of the widget display, on the other - it requires some familiarity with php and WP conditional tags.

It is controlled in a field at the bottom of each widget, which I find very logical.

Cheers,

Yuna M.


I usually install widget visibility without jetpack. It is the very same thing as the jetpack widget without the bloatware from jetpack. It gives you the option to show or hide any widget in any particular page ior in any kind of post format. I think it does the job.


I also use the Jetpack module.

Many people hate Jetpack, because it brings so much functions. But you can deactivate all unneeded modules. And I prefer one big and well maintained plugin as many different plugins.

Write a reply

Login or register to write a reply, it's free!