How to use wp_dropdown_categories() on widget field?

Hello Guys, Let's see how we can implement wp_dropdown_categories() on widget field. Here I am implementing codex way of making widgets: see here for reference: https://codex.wordpress.org/Widgets_API You can see more about wp_dropdown_categories() here: https://codex.wordpress.org/Function_Reference/wp_dropdown_categories So here we go-> /** * Adds Foo_Widget widget. */ class Foo_Widget extends WP_Widget { /** * Register widget with WordPress. [...]

Advertisements

How to crop image in customizer image field ?

Hello everyone, Today I am going to illustrate on , how to cropped image on customizer. Normally we use WP_Customize_Image_Control for selecting image on customizer section, but this doesn't provide you the featured to cropped image on your requirement. But WordPress provide us class called 'WP_Customize_Cropped_Image_Control' which provide you the featured to crop a image.You can [...]

Customizer selective refresh is not working?

Hi Everyone, We can get many tutorial and article in making selective referesh on customizer, which is introduced on WordPress Version 4.5. Here is the answer of the question if you find your customizer selective referesh is now working even you followed the whole procedure that is given on wordpress codex or by many of [...]

How to add custom image size with metabox?

Here is the procedure for adding custom image size on metabox/metafield of post I hope you all are familiar with after_setup_theme theme hook. Here i first defined image size using add_image_size function: example: //adding function_exists() before function will let user to customize the same function on child theme if ( !function_exists( 'theme_slug_image_size_for_metabox')) : function theme_slug_image_size_for_metabox(){ //set [...]

All Customizer panel & section lost

Today after updating my site to latest WordPress  version 4.5. i came along this issue. My customizer  preview init is totally blank with no section and panel. Along with i got this error on console Uncaught TypeError: data.defaultValue.substring is not a function How i solved this issue? First I deactivated all plugin installed on a [...]

How to add Woocommerce product category on customizer?

Here is the steps you need to follow to add product category on customizer without extending customize class: Add section for the woocommerce  setting add setting for the category add select option on add control function Create custom function to list category create function for sanitization add_action('customize_register', 'your theme_theme_customize'); function your_theme_theme_customize($wp_customize) { //create section $wp_customize->add_section( [...]

What are hooks on WordPress?

Most of the people may gone through many article on filter or action hook, but still can't get concept on hook of WordPress , then you are on the best place to learn. Here i am not going to illustrate about basic theoritical meaning of hooks, just i will provide simple demonstration on hooks. Before [...]