How to get popular post from across a network?

simple list all last post about the network, not the popular posts; for popular posts you must use an plugin or track via Google Analytics etc. <ul class=”postlist no-mp”> <?php $blogs = $wpdb->get_results( “SELECT blog_id,path FROM {$wpdb->blogs} WHERE blog_id != {$wpdb->blogid} AND site_id = ‘{$wpdb->siteid}’ AND spam = ‘0’ AND deleted = ‘0’ AND archived … Read more

Closest thing to an is_widget() tag?

Well, if you insist using get_template_part, the only solution I see is to define a global variable in your widget’s widget() function, and set it to true or something. After you call get_template_part in your widget, set this variable to false. Within your template check for that variable, and if it’s true, it means you … Read more

Multiple users editting widgets

I have never personally had this problem, but to the best of my knowledge WordPress does not have the system to support multiple users managing widgets at the same time, at least not widgets in the same widget areas. Is it a problem to just have one user at a time manage the widgets? I … Read more

Query for recent images across multiple posts

You can use get_posts or create a new WP_Query using the following args (or something similar). <?php $args = array( ‘post_type’ => ‘attachment’, // attachment post type ‘post_status’ => ‘inherit’, // all attachments have this post status ‘post_mime_type’ => ‘image’, // make sure you get images only ‘posts_per_page’ => 5 // however many images you … Read more

WordPress Custom Menu Widget Style

Purely with CSS you could set a width for menu items, float them and then set the UL to twice that: footer ul { width: 200px; } footer .menu-item { float: left; width: 100px } (I don’t know what elements you are using to designate your footer, you’ll need to update that to match your … Read more

How do i export the HTML from text widgets?

The data in the options table is stored as serialized arrays. Use get_option() to get the data and unserialize them. array_walk( get_option( ‘widget_text’ ), function( $d ){ if ( ! empty( $d[‘title’] ) ) { printf( ‘<p>Title: %s<br>Text: %s</p>’, $d[‘title’], htmlentities( $d[‘text’] ) ); } } ); If you need a complete plugin, use this. … Read more