Hide specific categories from category widget

I know this post is pretty old, but because I came across the same issue and this post came up higher than one with a solution, I figured I’d add this, which worked for me. Source: http://coffeecupweb.com/how-to-exclude-or-hide-categories-from-category-widget-in-wordpress-sidebar/ //Hide categories from WordPress category widget function exclude_widget_categories($args){ $exclude = “1,4,8,57,80”; $args[“exclude”] = $exclude; return $args; } add_filter(“widget_categories_args”,”exclude_widget_categories”);

Where is the content of widgets stored in mysql table

Widget options are stored in the options table under ‘sidebars_widgets’ as a serialized array. See this post for a longer explanation. Changing the field per PHPMyAdmin is not recommended, use PHP, get_option() and update_option() instead, WordPress will take care for correct serialization then.

Give Editor Access To Sidebar

The edit_theme_options capability should allow the user to edit the sidebar as described on this page : http://codex.wordpress.org/Appearance_Widgets_SubPanel Code to add to functions.php $role = get_role(‘editor’); $role->add_cap(‘edit_theme_options’); Edit: This should work to prevent editor accessing themes or menus function custom_admin_menu() { $user = new WP_User(get_current_user_id()); if (!empty( $user->roles) && is_array($user->roles)) { foreach ($user->roles as $role) … Read more

Limit number of Widgets in Sidebars

I solved this in Javascript. If you want to completely prevent it you should also do it server-side, because you can edit the widgets with Javascript disabled (try it out!). The different sidebars are checked when you drop widgets to them or away from them. If they become full, the background color changes and you … Read more

Loading scripts only if a particular shortcode or widget is present

You can use the function is_active_widget . E.g.: function check_widget() { if( is_active_widget( ”, ”, ‘search’ ) ) { // check if search widget is used wp_enqueue_script(‘my-script’); } } add_action( ‘init’, ‘check_widget’ ); To load the script in the page where the widget is loaded only, you will have to add the is_active_widget() code, in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)