Custom User Field in Dashboard Widget

There’s get_the_author_meta() for such a task. (get_* functions normally don’t echo/print the output – hence the name). // Both values are *optional* get_the_author_meta( $field, $user_id ); Normally it’s only meant to be used inside a loop to get the data of the posts author, therefore it internally uses global $authordata;. But, you can also throw … Read more

Image Uploader API

This tutorial explains basic use of WordPress media uploader. http://wp.tutsplus.com/tutorials/creative-coding/how-to-integrate-the-wordpress-media-uploader-in-theme-and-plugin-options To add image sizes use <?php add_image_size( $name, $width, $height, $crop ); ?> Read more on this at Codex http://codex.wordpress.org/Function_Reference/add_image_size

Print owned created widget

For reference, the_widget The way the_widget() works, is that you must either pass it $instance (array/string) which will have all of the form values of the widget. They give an example of the Archives Widget on the codex page. You can also pass $args which controls what text is displayed before/after the widget and the … Read more

Making footer widgets responsive

Set the width of the div to 100% and remove the float for the media query used for smaller screens like this: @media screen and (max-with 600px){ .widget-area{ float: none; width: 100%; } } And for the desktop view: @media screen and (min-with 600px){ .widget-area{ float: left; width: 25%; } } BTW, this is just … Read more

Dynamic sidebar based on category

There are many solutions to your problem, I guess. Two solutions I would recommend are: 1. Register multiple sidebars. Register more sidebars and then include them conditionally in page templates. So if you need different sidebar for each category (let’s say you have 2 categories), then register 2 more sidebars (sidebar-cat-1, sidebar-cat-2) and then replace … Read more

Dashboard Widgets – Add Admin Page With Same Functionality

I guess “easy” is a relative term. Yes, you can create your own. For adding an admin page there are a glut of tutorials out there. This one works (and has some other info you might need) http://wp.smashingmagazine.com/2011/03/08/ten-things-every-wordpress-plugin-developer-should-know/. Search for “Add Your Own Settings Page or Admin Menu” on the page. jQuery UI is loaded … Read more

Debug errors on sidebar

You should check that the variable exists before using it. isset() will return true if a variable has been set and is not null. For example: update_post_meta($post->ID, “_sidebar”, $_POST[“link”]); will become: if ( isset( $_POST[“link”] ) ) { update_post_meta( $post->ID, “_sidebar”, $_POST[“link”] ); } As an aside, it’s a good idea to validate your data … Read more

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