Tag Info

New answers tagged

0

You can filter the Login URL: add_filter( 'login_url', 'wpse100354_my_login_url' ); function wpse100354_my_login_url( $login_url ){ return site_url( '/your-login-url' ); } Caveat: I haven't tested this. References Codex wp_login_url() Source code Adam Brown's reference for login_url filter Trac page for wp-includes/general-template.php


1

I'm not sure that what you want is possible. Per the WordPress Codex page on Multisite: You are given the choice between sub-domains and sub-directories, except when existing settings restrict your choice. You must choose one or the other. So you can set your network up to use either sub-domains OR sub-directories for your child sites, but not ...


0

After setting define('WP_ALLOW_MULTISITE', true); in your wp-config.php file and doing "Network Activate", you need to copy some new constants to your wp-config.php file. Are the following constants definitions there? define('MULTISITE', true); define('SUBDOMAIN_INSTALL', true); define('SITE_ID_CURRENT_SITE', 1); define('BLOG_ID_CURRENT_SITE', 1);


1

Yes, a multisite is what you need. The membership part is arguably a separate question, and there are many ways of doing it. I would suggest a dedicated members site users register to, but there are lots of other ways of doing it, and there is no definitive answer. See here for what to do before you create a network This is how you'd create a network ...


0

User profiles are shared across your multisite network. If your membership system creates new WordPress users (it should), then you should be able to have them join the primary site. If you want them on the subsites, what you will need to check is whether your membership system shares the membership info across other sites, and figure out how to add them to ...


1

It was actually much easier than I originally thought - just doing a WP_User_Query for a meta value (meta arrays are supported as well, like for the other query classes). public function on_deactivate() { $meta_key = 'tools_page_tsi_per_page'; $query = new WP_User_Query( array( 'meta_key' => $meta_key ) ); if ( empty( $query->results ) ) ...


0

First you will need a multisite network then make sure your plugin is compatible with Multsite network and have the options you looking for. Then you are good to go. If you are not going to use any plugin, then simply just add all users of your Multsite to all of your sites and give them the same permission. To enable Multisite, simply open your ...


1

There is no way to add a page template through the WP-Admin screens in vanilla WordPress. To create a page template, you simply create a new .php file in your theme's folder and add this comment to the top: <?php /* Template Name: YourTemplateNameGoesHere */ ?> You will then be able to select that template from the page edit screen. If you're ...


1

I found the solution , it's dead simple, I should add myself to the child site as a user, I guess this should be done by default.


0

According to this codex entry, it is not possible to install WordPress in a sub-directory and use the Sub-domain install. However, you should be able to install WordPress in a sub-directory (example.com/foo) and use the other sub-directories for your networked sites (example.com/bar). Also, check out this entry for more info on installing WordPress in a ...


1

I found the issue, thanks to @Toscho giving me the spark of an idea. We are using custom user roles and capabilities. It had something to do with the User Role Editor plugin. Deleted the custom role, and created a new one, reassigning all capabilities. Then updating all users to the newly created user role. Problem fixed. Not sure why that happened, but ...


0

If you create the new blog using your email address, it will be owned by your user. Because you are acting as the super admin, it assumes you are creating for a new user. Not entirely sure what you mean about my blogs, but if you follow the steps above then the new blog will appear in the drop down admin bar when you are logged in and browsing any site / ...


2

The WordPress function switch_to_blog() expects an integer as an input parameter. You can read more about it in the Codex: http://codex.wordpress.org/Function_Reference/switch_to_blog Please try this kind of structure instead: <?php $original_blog_id = get_current_blog_id(); // get current blog $bids = array(1,2); // all the blog_id's to loop through ...


0

Check for any filters that only return if certain conditions are met. I had an issue once where almost all my pages' content areas were blank. I found the problem was in a snippet of code that looked like this: add_filter( 'the_content', 'this_will_blank_pages' ); function this_will_blank_pages( $content ) { if( is_page( 'some-page-title' ) ) { ...


2

To copy a post from one blog to another you can do something like this: function copy_post_to_blog($post_id, $target_blog_id) { $post = get_post($post_id, ARRAY_A); // get the original post $post['ID'] = ''; // empty id field, to tell wordpress that this will be a new post switch_to_blog($target_blog_id); // switch to target blog ...


0

Your question begs another question - do I need separate websites? Building a WP multisite can introduce some huge headaches (stability, conflicts, confusion, etc) into your life, and I'd almost always discourage it. If you are concerned about SEO, there is a good video by Matt Cutts, of Google, on the subject: https://www.youtube.com/watch?v=_MswMYk05tk ...


0

Solution (or at least in part) The problem is switch_to_blog doesn't give you access to everything in another blog on the network including taxonomies, tags, things in your functions.php, although don't quote me 100% on that. Therefore the taxonomy wasn't registered in the "switched to" blog. My solution (at least for now) register the taxonomy in that ...


2

The plugin should use the API, not some made-up SQL. addslashes() is not safe enough anyway. $user = get_user_by( 'email', 'user@example.com' ); echo $user->ID; Besides that, the user tables are almost the same, there are just some tighter restrictions for user names in multi-site, because new sub domains could be made from the names.


0

Google led me to this page: http://lauragentry.com/blog/2012/01/05/when-wordpress-network-subdomain-blogs-wont-let-you-log-in/ There's a chunk of code in there that I added to my wp-config.php file, to wit: define('ADMIN_COOKIE_PATH', '/'); define('COOKIE_DOMAIN', ''); define('COOKIEPATH', ''); define('SITECOOKIEPATH', ''); What I don't quite understand ...


0

This is a long shot and assumes all your taxonomies are setup and being queried correctly. But since you are using wp_reset_query() anyways try using query_posts() with your $args and use while(have_posts() : the_post()) instead of a doing a new WP_Query() class. Then restore_current_blog() before your wp_reset_query() at the end. Also your var_dump ...


2

The function that deals with this is ms_site_check(). If existent, it will use the following files. And they should render a full custom HTML page. WP_CONTENT_DIR . '/blog-deleted.php' WP_CONTENT_DIR . '/blog-inactive.php' WP_CONTENT_DIR . '/blog-suspended.php' Another option is to short-circuit the process and redirect the visitor. It has to be done ...


0

Rewrite rules should not have absolute paths. This was likely caused by a bug, fixed in WP 3.5.1, see Changing subdir multisite install to subdir core directory structure question. Update to 3.5.1 (if you aren't on it already) and regenerate htaccess rules.


0

Add a RedirectMatch to your dev site’s .htaccess to tell Google the canonical addresses are on the new site: RedirectMatch Permanent (.*) http://new.example.com$1


0

Problem resolved, turns out there was references to BuddyPress is my theme which were causing a conflict My theme was originally a BuddyPress theme, I had since ditched BP and was using the theme as a standard WP theme. Still lingering in the template information file was.... Template: bp-default Tags: buddypress With these tags the theme still ...


0

The reason you're having trouble here is that you're applying a universal filter to upload_dir. Rather than doing this, use a conditional filter for upload_dir after first checking ['mime-type'] for application/pdf. You need to intercept the upload process at the wp_handle_upload action hook and alter the upload folder there. What you have posted is ...


0

I installed Contact Form 7 hit network activate and then went to an individual site, 'contact' showed up on the dashboard but when I clicked on it it said 'no item found' although the title at top of page said 'Contact Form 7' I discovered what you need to do is hit the 'Add new' button next to it and that will activate it, hope this helps!


1

The following query works. Note the quotes in AND blog_id != '1' global $wpdb; $query = " SELECT blog_id FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' AND blog_id != '1' ORDER BY blog_id ASC"; $blogs = $wpdb->get_col( $wpdb->prepare( ...


0

It was a very silly mistake I made. I did not tick the public box in the network site settings on any of my site. This why get_last_updated(): was not returning anything.


1

This is not exactly worpdress multisite suggestion, but a hack to run and manage multiple wordpress websites. I don't know if it works for you : STEP 1. Move your wordpress installation to its own directory say common (Instructions can be found at http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory) STEP 2. Change the path of wp-content folder ...


1

You can try this instead of get_last_updated(): global $wpdb; $blogs = $wpdb->get_results("SELECT blog_id, domain, path FROM {$wpdb->blogs} ORDER BY last_updated DESC" , ARRAY_A ); print_r($blogs); just to see if it changes anything to skip the public, archived, mature, spam , site_id and deleted filters.


0

Check out these instructions, Debugging a WordPress Network. That kind of problem is usually caused by a configuration error in the .htaccess file. Check also this page, Multisite configuration fails with css/js files


0

There are quite a bit of plugins available to do this for you, a quick Google search will get you there. Bloglist, recent posts and comments from the whole network. Can be found here. A central area where all the posts on a WordPress MU or WordPress MS site can be collected. Can be found here. A list of premium plugins (one matching ...


0

After playing around with it a bit more, here's what finally worked for me: <?php global $bp; $thisblog = $current_blog->blog_id; $user_id_from_email = get_user_id_from_string( get_blog_option($thisblog, 'admin_email')); $myfield = xprofile_get_field_data( 'Counties Served', $user_id_from_email, $multi_format = 'comma' ); $data = ...


0

$bp->displayed_user->id returns the same id as the author id so when you are not inside a members loop or on a members page you have to get the user id using WordPress functions. <?php global $bp, $post; $myfield = xprofile_get_field_data( 'Counties Served', $post->post_author, $multi_format = 'comma' ); $data = ...


0

Or For adding your sites on "My Sites" if you've missed them, then you can add them by go to Network Admin > Dashboard > All Sites > Edit Your Desired Site > Users (Tab) > Add Existing User > Add your desired existing username and role it as "Admin" Regards.


1

Store site specific data in regular options. See add_option(), get_option() and so on. Store options for the complete network in a site option. See add_site_option() and related functions. You can add new fields for these options in a separate admin page or use an existing page for that. For the latter see my plugin Public Contact Data which does exactly ...


1

Try to set the constant COOKIE_DOMAIN to an empty value or the value of the real address. Example: define( 'COOKIE_DOMAIN', '' ); Be aware WordPress has a lot of issues with symlinks, so there might be other problems too.


0

As mentioned in the answer of RRikesh, a multiside installation make it all easier because it's the same database and you have access to it. If you have problems connectiing to the foreign database (maybe some security restrictions or the database is not on the same server), you have to do a bit more work. In this case, you can fetch the feed, parse and ...


2

Non-Multisite setup: You need to create another instance of the WPDB Class. $newWPDB = new wpdb('Username','password','database','localhost'); $rows = $newWPDB->get_results("you-query-here"); On WordPress Multisite: Does having Wordpress MultiSite make things a lot easier or should we stick with single installations? There is the ...



Top 50 recent answers are included