• I am trying to keep one links list with 4 (and possibly more) blogs. I tried importing using the wp-links-opml.php file, but it didn’t keep the categories intact. All the blogs share a database with different prefixes. Is there any way to display the links list from one on all of the other blogs, so I can just update one and all of them will display the current list?

Viewing 2 replies - 1 through 2 (of 2 total)
  • A (down and dirty) way to do this when using the same database* for all blogs:

    Edit the core code for the link tag(s) and hardcode which table to access for your links. For example, if you’re using the get_links() tag to display links from the Links Manager, locate the get_links function (in wp-includes/links.php) and in the initial $sql variable value assignment (“SELECT link_url, link_name, … etc.), change

    FROM $wpdb->link

    to

    FROM PREFIX_link

    PREFIX_ will be the table prefix for the blog you’ll be managing links from. So if this is wp_, make it:

    FROM wp_link

    If you’re using a different template tag to display links, you’ll need to make the above change as well as alter the sql query line within the function for that particular tag (also located in wp-includes/links.php). Just look for variables within those initiated using $wpdb->get_var, $wpdb->get_row or $wpdb->get_results, and change all references to $wpdb-> within it to your prefix.

    This would need to be done to each blog’s setup (except for the one managing the links), but then you’d only need to edit the file once, and upload to each blog’s wp-includes directory.

    Note: Back up source files you are editing, and comment any changes for future reference.

    * A different database for each blog requires reconnecting to the database holding the links each blog is reading from, and would entail an entirely new process outside of WordPress to accomplish this.

    Thread Starter spartro

    (@spartro)

    I knew there was a quick and dirty fix buried in there. Worked fine. thanx

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multiple Blogs–One Links list’ is closed to new replies.