Desperately trying to enable a widget from functions.php file…
When I use it as plugin the widget is available in widgets page and can be included in any widget area.
I want it to show up in the widgets page by itself, without using a plugin for it.
How can I register this widget from functions.php, don’t want a static position but user must be able to drag and drop it to a widget area from the widgets page.
Any help = highly appreciated!
function quokka_sidebar_tagcloud($args) {
extract($args);
echo $before_widget;
quokka_tag_cloud('sidebar-tagcloud');
echo '<br class="clear" />';
echo $after_widget;
}
function quokka_sidebar_tagcloud_init()
{
register_sidebar_widget(__('Quokka: Sidebar Tagcloud'), 'quokka_sidebar_tagcloud');
}
add_action("plugins_loaded", "quokka_sidebar_tagcloud_init");
Try calling
in init and not in “plugins_loaded”. Like this
Also this snippet of code is not inside any block or function in the functions.php file right?