Widget – link to page rather than absolute url

Perhaps this approach will work for you. I like to use PHP Code Widget, which is like a regular Text widget, but one that allows you to use WordPress functions and other PHP in the body. Once you install that widget you could then use one of the WordPress functions like get_page_link() or get_permalink() to … Read more

Widget without DIV wrapper

Check out the register_sidebar() function in the codex: before_widget & after_widget – are your wrapper. before_title & after_title – are your wrapper around the widget title. They are optional parameters that can be omitted but as @Tom J Nowell noted, you’ll encounter many headaches without proper sidebar structure.

Filter widget outputs

The stock “category” widget uses wp_list_categories() and passes the arguments though widget_categories_args in the process. 716 /** 717 * Filter the arguments for the Categories widget. 718 * 719 * @since 2.8.0 720 * 721 * @param array $cat_args An array of Categories widget options. 722 */ 723 wp_list_categories( apply_filters( ‘widget_categories_args’, $cat_args ) ); You … Read more

Problem creating an array instance in a widget in 4.4 update

Problem solved! Still don’t know what has changed in the 4.4 update though. Prior to 4.4, you can use the square brackets reverted to generate an array instance, like that: <select multiple=”multiple” name=”<?php echo $this->get_field_name(‘cats][‘) ?>”> //$instance[‘cats’] = array(); Starting from 4.4, you can use square brackets in regular case, like that: <select multiple=”multiple” name=”<?php … Read more