New answers tagged

0

This works for me tested on WordPress 4.5.2 function nand_filter_widget_titles($title) { if ( $title != '') { $title = '<span class="icon-someicon">' . $title . '</span>'; } return $title; } add_filter( 'widget_title', 'nand_filter_widget_titles' );


0

Your widget is okay but problem is customizer do not show sidebar option if there is no sidebar is called on current viewing page. You did register the two siderbars but did not call them any where in the template of page your are seeing in customizer. Use dynamic_sidebar function and call your sidebar somewhere in the template. Example:- dynamic_sidebar(...


0

You mean like this: if (is_active_sidebar($sidebar-name) && is_page($page-id)) {do your thing} ?


0

You should make the check inside the widget class, unless you don't have a choice. The example in the codex is pretty much what you're looking for: class cbs_map_widget extends WP_Widget{ function cbs_map_widget(){ $this->WP_Widget('cbsmaps', __('Widget Name'), array('classname' => 'cbsmaps', 'description' => __('whatever'))); ... ...



Top 50 recent answers are included