How to change widget’s form color in admin?

Register/enqueue an admin stylesheet function my_admin_theme_style() { wp_enqueue_style(‘my-admin-theme’, get_template_directory_uri().’/admin-style.css’); } add_action(‘admin_enqueue_scripts’, ‘my_admin_theme_style’); Then add rules of the form #widget-list div[id*=”_archives-“], div[id*=”_archives-“] { background:red; } Consider that proof of concept. I will leave it up to you to target the precise elements you want.

random reason on refresh

You say that you are… … wanting to add a random reason (quote) as to why they should join which will change after every reload of the page And you seem to trying to do this by placing Javascript in a text widget. I assume that is what you mean by the ‘”text” in the … Read more

Link a widget or find the php that creates the widgets

If the widget is part of the wordpress core, you can see its source in wp-includes/default-widgets.php. If it came with a theme or plugin, you can find the code there. Sometimes widgets will be in an obviously-named widgets.php, but other times you’ll have to hunt for them. At some point, each widget has to be … Read more

how can i display all youtube videos from a users youtube account

You can use YouTube developer API. Example how to get recent videos below: $data = wp_remote_get(‘http://gdata.youtube.com/feeds/api/users/<USERNAME>/uploads/?start-index=1&max-results=40’); $response = new SimpleXMLElement($data[‘body’]); foreach ($response->entry as $entry): $vid_id = ”; if ( preg_match(‘#videos/([^/]+)$#’, $entry->id, $matches) ) { $vid_id = $matches[1]; } if ( $vid_id ): ?> <a href=”http://youtube.com/watch?v=<?php echo $vid_id; ?>”> <img src=”http://i.ytimg.com/vi/<?php echo $vid_id; ?>/1.jpg” width=”220″ height=”130″ … Read more

how to show only particular category post in archive widgets

add_filter( ‘getarchives_join’ , ‘getarchives_join_filter’); function getarchives_join_filter( $join ) { global $wpdb; return $join . ” INNER JOIN {$wpdb->term_relationships} tr ON ($wpdb->posts.ID = tr.object_id) INNER JOIN {$wpdb->term_taxonomy} tt ON (tr.term_taxonomy_id = tt.term_taxonomy_id)”; } add_filter( ‘getarchives_where’ , ‘getarchives_where_filter’); function getarchives_where_filter( $where ) { global $wpdb; return $where . ” AND tt.taxonomy = ‘category’ AND tt.term_id=’blog category id’ … Read more

Simple form to add custom links to menu?

Well, since you’re talking about a widget of Links…. why not just use the default Links widget that was part of core up till 3.5? http://wordpress.org/plugins/link-manager/ If you insist on limiting it to showing the latest 5 links, you’re going to have to write a bit of code (that I’m not convinced is worth it). … Read more

Dynamically creating multiple widgets from Mustache templates

How do I register multiple widgets with a single class definition? You don’t. Modern class based Widget API in WP assumes that one class corresponds to one widget. Note that you can still have intermediary subclasses – (extend WP_Widget, then extend it once more) but what you register in the end is still one widget … Read more

widget not displayed

you can use dynamic_sidebar() function to display a sidebar in a page. dynamic_sidebar(‘Name or ID of dynamic sidebar.’)