This plugin can be used to connect to another wordpress blog. I created this widget to display a list of posts from another blog of mine that resided in a subdomain on the same server. The options you have is to display posts from multiple categories from your sub blog.
Let’s say that you have a blog www.yourblog.com and another blog named sub.yourblog.com and you wish to display a list of posts in your www.yourblog.com from sub.yourblog.com what you can do is install the plugin in www.yourblog.com and configure it. This plugin needs some information in order to connect to the database of your other blog. You can find all the needed information in your wp-config.php file of your sub.yourblog.com. You can display a summary of each post including a link to the category that it belongs to.
Installation
Unzip the plugin/widget into your plugins directory and activate it
Usage:
- go to Settings and select Connect2Site
- write a header for the widget (if you use one)
- enter
- Category ID = the category ID number of the category that you want to display posts from (in the example from sub.yourblog.com). You can specify multiple categories delimeted by comma (i.e. 22,44,55)
- the database name of your sub.yourdomain.com (check your wp-config.php file ***)
- DB Prefix = the DB_prefix usually wp_
- dbUser = the user name that connects to your sub.yourdomain.com database
- dbPassword = the password of the user above
- Domain = is the full domain name to connect when you click a post (in the example sub.yourdomain.com)
- Limit Posts = how many posts you wish to be displayed
- Limit Summary = the number of characters to display from the post content
- Display category name = check it if you wish to display the category name (and a link)
- Display comment count = check it if you wish to display a comment count
- Open in new window = if checked the output will be displayed in a new window
- click Update settings
- You may use the widget for your sidebar
You can see an example of the widget in my sidebar with the title WWW.KOUNOUPAKI.GR. In this widget I have selected two different categories, category and comment display. Links to my blog are opened in new window (may be it looks Greek to you but it is !). Check out the short codes here.
*** wp-config.php sample. The required fields are marked as WIDGET FIELD
1 2 3 4 5 6 7 8 | // ** MySQL settings ** // define('DB_NAME', 'mywordpress_db'); // THIS IS WIDGET FIELD dbName define('DB_USER', 'dbusername'); // THIS IS WIDGET FIELD dbUser define('DB_PASSWORD', 'mysecretpassword'); // THIS IS WIDGET FIELD dbPassword define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value define('DB_CHARSET', 'utf8'); // You can have multiple installations in one database if you give each a unique prefix $table_prefix = 'wp_'; // THIS IS WIDGET FIELD DB prefix |
Troubleshooting: in case of a problem deactivate the plugin or delete it from your plugin directory.
DOWNLOAD Connect2site
RELEASE HISTORY
CURRENT RELEASE Connect2site 1.2.3
- Minor fixes
- CHANGE:Added connect2site id for CSS playground
RELEASE Connect2site 1.2.2
- BUG FIX: When no post limit is set you get a DB error
- CHANGE:Display Posts in descending order (latest first)
RELEASE Connect2site 1.2.1
- Added H3 tag in post title when using post short code
RELEASE Connect2site 1.2
- Changed: moved widget setup to settings
- Added: Short codes to display results in Posts and/or Pages
- Added: Short codes with various independent options to dipsplay more categories
- Added: Short code to display a single post in a page (full or exceprt content)
RELEASE Connect2site 1.1
- Added: Multiple category selection (more than one category post dipslay)
- Added: Display (on/off) post summary (limit number of characters)
- Added: Display (on/off) comment count
- Added: Display Category (with link to sub blog category id)
RELEASE Connect2site 1.0
Initial Release
Popularity: 100% [?]



{ 10 trackbacks }
{ 25 comments… read them below or add one }
hi. Thanks for plugin
perfect.
Regards
Thanks baron, soon I will add some more features to the plugin to be more attractive. Suggestions are welcomed !
ML
I don’t undestand but it looks like if you add to the sidebar the RSS of other site isn´t it?
Regards
I agree with Jose that this could be accomplished very easily simply using an rss feed widget and a category, tag, or even author feed all of which are standard in wordpress. That said I do see future development possibilities that could be put to cross posting from other blogs into your established category structure, that sort of area has a great deal of potential for Wordpress MU blogs.
@Jose Perez: your are almost right but this widget is the first step. It looks like incorporating a simple rss feed, but in future development the main blog actualy can be a union of multiple blogs and or cross posting (as brad hart said). The second step to this widget will be multiple categories, post summaries and direct link to the sub blog category posts.
Great. I just look around for this. I think it’s not same with rss feed, it will be more customizable
Hi ali, check the description of the upcoming version 1.1 it has more options.
super plugin. thanks…
finally i found this super plugin,thanks
@Rasit and @yudhiie
Thank you for your comments.
Hi and thanks for this wonderful plugin. I’m sure a lot of users that have multiple blogs will enjoy this.
Would be nice if you could also get other info from other domains and not just sub-domains.
Hi George,
thank you for your comments. This plugin actually works for domains located in the same server (not only subdomains). What I am considering is adding more connections to subdomains at the same time, but it don’t think that’s a good idea.
Not sure why I am getting these errors but otherwise it looks and works great! Thanks!
Warning: extract() [function.extract]: First argument should be an array in /home/nourisho/public_html/wp-content/plugins/connect2site/connect2.php on line 28
Warning: mysql_close(): supplied resource is not a valid MySQL-Link resource in /home/nourisho/public_html/wp-content/plugins/connect2site/connect2.php on line 120
@Stephen
I visited your blog. Please provide me with some info : are you using the latest version of the plugin ? I have some issues with the wordpress plugin repository and the latest version is not showing in the main page. If you are not using the latest version please download it – version 1.2.1
-I see you are using multiple categories so check for spaces between category ids (you should separate them with comma)
-Are you including an empty category ?
-Which is your category (the name) that the plugin does not display ?
Michael
Awesome plugin, just what I needed THANKS!
Warning: extract() [function.extract]: First argument should be an array in /home/nourisho/public_html/wp-content/plugins/connect2site/connect2.php on line 28
Warning: mysql_close(): supplied resource is not a valid MySQL-Link resource in /home/nourisho/public_html/wp-content/plugins/connect2site/connect2.php on line 120
Stephen, i just remove extract($args); on line 28
and line120 the connection close not $rst but it have to close $db.
hope some one correct me if i m wrong;
@gulflee: you are right on the db parameter, there is a new version coming up. But don’t take the extract($args) out from the widget function !
filos, i m trying to make the “get_target_post()” work, direct call from single post.
$sql = ’select id as s_id, post_title as s_title, post_content as s_Content, post_excerpt as s_Excerpt, comment_count as s_Comments from ‘.$connect2_pre.’posts where ‘.$connect2_pre.’posts.post_type=”post” and ‘.$connect2_pre.’posts.ID =”449″‘;
but it return nothing when “$rst = mysql_query($sql, $db); print_r (mysql_fetch_assoc($rst));”. When ever single post is specific it return nothing(wp_posts.ID=”449″). Can help?
@gulflee: the proper call in a page or a direct post is through the short codes, for example if you want to import the full post with ID 449 you enter in the single post the following short code: [c2s type="post" num="" chars="" cat="" post="449" exc="0"] or if you want to import just the excerpt [c2s type="post" num="" chars="" cat="" post="449" exc="1"].
I haven’t managed to simulate the error you are getting. Are you calling the function using a PHP call to the get_target_post(arg1,arg2) function ?
i am wanting to link to multiple subdomains. is there a way to install this using another name such as “connect2site-1″ or “connect2site-a”, or whatever? It is a great widget and does exactly what i want, but I need to link to two or three at the same time.
@balej , the current version of the plugin supports one subdomain.
I don’t use widgets I hand code my themes. Is there a way to use your plugin w/out the widget. Can I do something like and have it display?
@Derek, in the latest version of the plugin there is no need to add the widget to your sidebar. Your options are 1) use the shortcodes 2) check out the source code to see the functions and parameters that the short codes are using and use them in your theme for example :
Displays the excerpt of a single post with ID 35.
In case of a problem check if you are missing the parameter loading that you have entered in the plugin setup.
Wow this is exactly what I’ve been looking for, I think. If I can make this work on MU it would be amazing. (this should really be built into the MU core, imo)
about to install this plugin. testimony soon.