Using A Shared/Common Theme Across Multiple Sites

If you’re using multisite, you can upload a theme as the super admin and force enable it across the network. However, from what I’ve read in your question, it appears like you are trying to share contents across the network, not just the theme. This can be somehow tricky. In such scenarios, you can use … Read more

Why would switch_to_blog stop working?

It appears that switch_to_blog might be too unpredictable to rely on for major site design. Here’s my first attempt at a SQL-based solution. function get_intro_post($blogid, $thumb_size=””) { global $wpdb, $post; // Get the system defined table prefix $prefix = $wpdb->prefix; // Create a full table prefix by combining the system prefix with the blogid $tbl … Read more

WP Nav menu append to url

I found the solution modifying the behaviour of wp_nav_menu with the wp_get_nav_menu_items-filter. Here’s a somewhat complete example: class ModifyLinkFilter { protected $_prio = 10; protected $_args; public function __construct($addargs = array(), $prio = 10) { $this->_args = $addargs; $this->_prio = $prio; if(!empty($addargs)) { $this->register(); } } public function register() { add_filter(‘wp_get_nav_menu_items’, array($this, ‘on_nav_items’), $this->_prio, 3); … Read more

Create a network of blogs with WordPress 3

For setting up a network of sites on different domains use: http://wordpress.org/extend/plugins/wordpress-mu-domain-mapping/ Otto has a great tutorial on the subject: http://ottopress.com/2010/wordpress-3-0-multisite-domain-mapping-tutorial/ Andrea’s ebook and Otto’s tut helped me a lot with my first setup!

Redirect users on logout

you can use wp_logout_url( $redirect); as Pippin sugested if you are echoing out the logout link and if you need it for the built-in logout link on the backend you can use: //function to redirect after logout function logout_redirect765(){ wp_redirect( home_url() ); exit; } //hook function to wp_logout action add_action(‘wp_logout’,’logout_redirect765′);