How to hide a Sidebar from other admins?

Here is the solution I’ve used which is css based. global $pagenow; if (in_array($pagenow, array(‘widgets.php’))) { function Only_show_to_webmaster_user_things_by_css() { global $current_user; $username = $current_user->user_login; if ($username == ‘Your_Username_Here’) { } else { ?> <style>#Sidebar_ID_Here{display:none !important;}</style> <?php } } add_action(‘admin_head’,’Only_show_to_webmaster_things_by_css’); }

Searchresult sidebar change

Your search.php may contain the following code <?php get_sidebar(); ?> If a name ($name) is specified as an argument then a specialized sidebar sidebar-{name}.php will be included. If sidebar-{name}.php does not exist, then it will fallback to loading sidebar.php. If the theme contains no sidebar.php file then the sidebar from the default theme will be … Read more

Add the title of a widget as an ID – for anchor links

Yes you can add an around the title of the widget, you do this in the register_sidebar code which you would put in your functions.php add_action( ‘widgets_init’, ‘theme_register_sidebars’ ); function theme_register_sidebars() { register_sidebar( array( ‘id’ => ‘mysidebar-sidebar’, ‘name’ => __( ‘My Sidebar’, ‘themename’ ), ‘description’ => __( ‘Widgets for my sidebar’, ‘themename’ ), ‘before_widget’ => … Read more

How to attach sidebar to shortcode’s output?

I’m still not sure exactly what you’re trying to do, but here’s one possibility if it’s to display something like this: PAGE CONTENT | SHORTCODE/POSTS LOOP | SIDEBAR Do you have control of the shortcode content? If so, you could update it so its output is wrapped in a <div id=”shortcodecontent”> –shortcode post-loop output– </div>. … Read more

Display X images from a gallery in the sidebar

Sounds like you need a custom query in order to pull X amount of images. You could do the following (untested): <?php function custom_gallery_display( $number_of_images = 4 ) { //make sure you have access to the WPDB object global $wpdb; //pull 4 random attachments $images = $wpdb->get_results(“SELECT ID from wp_posts WHERE post_type=”attachment” ORDER BY RAND() … Read more

Resizing Picture

#sidebar_img img { width: 250px !important; height: auto; } #sidebar_img { text-align: center; } use this css.. change 250px with whatever you want.

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