Bulk theme settings in wordpress multisite

If you configure your Theme settings code properly, the Theme will work fine without having any user-defined settings. The key is to define a defaults array, and anytime you need to output a Theme option, run an array_merge() on the defaults array, and the theme’s options DB entry. Something like this: <?php global $mytheme_options; $mytheme_options … Read more

Multisite Pull Recent Image Attachments from Blog ID

Use switch_to_blog to switch blog contexts to a specific blog ID. From there on it’s all down to get_posts of the attachment type. And switching back to the current context with restore_current_blog. Something like this: switch_to_blog( $blog_id ); $args = array( ‘post_type’ => ‘attachment’, ‘numberposts’ => 5, ‘orderby’ => ‘post_date’, ‘order’=> ‘ASC’ ); foreach ( … Read more

Stop WordPress Entirely and Run My Own Code

You could hook init and check the current blog ID function wpa85780_my_app_init(){ $my_blog_id = 99; if( $my_blog_id == get_current_blog_id() ): include ‘somefile’; exit; endif; } add_action( ‘init’, ‘wpa85780_my_app_init’ ); This will exit before WordPress does the main query and loads the template. EDIT a slightly earlier action you could hook is after_setup_theme, that seems to … Read more

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