How to keep two wordpress blogs under the same site? - php

I am working on a blog in the media front. I want to create two blogs under the same wordpress site in such a way that the session and the user base is common for the both and i even want to have the same url for both that is
www.example.com
for both. So is there a possibility to do that and as of now i have created two separate blogs under the same database but the issue is the session is separate for both and even the user base and even the url changes. So can someone help out with this. All i need is a little guidance and i can build upon it.
thanks

If you want two WordPress blog and one database for the user. You need to add following code into your both wp_config.php
define(CUSTOM_USER_TABLE,'wp_users');
define(CUSTOM_USER_META_TABLE,'wp_usermeta');
Also you need to Replace the wp_ with the prefix to what you want. You may see https://wordpress.org/support/topic/two-blogs-working-from-one-user-database for more help.

Related

Best Way To Merge My Existing Custom User Database With WordPress?

I'm sure this has been asked before though I can't seem to find a clear answer or clear direction on how to handle this. Would appreciate a point in the right direction.
I have an existing custom website/web app with about 7,500 current registered users in the database and I want to add a WordPress help forum. I have installed WordPress and a Q & A plugin in a help dir on my site. What's the best way to handle not having to use the wp databases?
I have played around a little and wrote a plugin that pulls my session/cookie data userinfo on the WordPress pages, can I somehow manually set or override the existing wp user_id and other vars so that when a new entry in entered it corresponds with my current database?
I'm also assuming I would need the register link to be changed to my site reg page as well as update WordPress somewhere so that it pulls names/emails of entries userid from my database.
Is this even the right way to handle this or is there a better way?

populate Wordpress page/post from external db - on the fly

After providing an event calender with PHP/MySQL/HTML/CSS I want to use Wordpress for that project from now on. Account and data management will remain outside of wordpress scope.
My best idea so far is to populate the posts (or pages) entirely from the already existing db. The URLs would be created by apache's rewrite engine.
To use one post and populate just the content would lead to really bad SEO.
So I want to create (virtually) unique posts populated entirely from the db. Extensive research on that topic brought up nothing usable so far. Maybe someone could point me in the right direction?
Preferences:
using mod rewrite to create the pages urls from event /ID/title rather than using the timestamps to create posts
keeping the data editable via external admin panel (no copying into WP-DB)
head data of post / page must be populated from db, e.g. title, author, timestamp etc.
Suggestions would be much appreciated, thanks in advance.
Have you tried the plugin WP All import. It creates unique post such are car listing etc based on the external DB. I also allows you to style and format your post.
https://wordpress.org/plugins/wp-all-import/

Drupal site with same database for two sites - I need better solution

I am now working on a drupal project, the client needs same admin side and same database to save the content, But he needs visualize things separately. That is two sites running same code base. These two are sharing same contents. Such as news,reports etc.
What is the best way to implement this, I read some multisite doc, but its based on two admin side and different database.
Thanks in advance.
You should look into the Domain Access module. It will allow you to use a single database for a multisite setup (sharing all users and content). One of the sub modules within it Domain Theme allows you to set the active theme for each domain (making each site look different)

Multiple hostnames for a single Wordpress blog to control displayed post categories

Wordpress related
Multiple hostnames for a single Wordpress blog to control displayed post categories
Can it be done?
If not, why not
Else, how may I? :3
I'm trying to maintain a single blog but only show posts from a particular category for a certain host name :/
I found http://codex.wordpress.org/The_Loop#Exclude_Posts_From_Some_Category but it's not going to change the domain in links, etc :/
Thomas - there are a few ways you could achieve this. If you want a solution that doesn't involve setting up a separate WP network for each hostname (assuming you're using WP 3.1), a neat way might be to rewrite the URL at the web server. WP already requires you to cofigure rewrite rules for pretty URL support, so there's no reason why you could internally map category.example.com into www.example.com/category. If you made all your site's links relative, this could work reasonably well.
Otherwise, I'd create a network for each hostname, and write a multi-site plugin that adjusts the WP_Query for any request received on a 'category' network, to retrieve posts from the main blog with a category filter. But you'd probably end up fighting WP every step of the way :-)
There may be a neater solution.

How do I make a single WordPress installation seem to power two sites?

I'd like to set up a single WordPress installation at siteA.com with 2 static pages and a blog. I have two domain names and I would like to set it up so that siteA.com shows page 1 as its home page, and siteB.com would show page 2 as the homepage. Both sites would share the blog contents.
Since the Wordpress installation resides at site A, how can I create a seamless experience for the user who visits site B?
Say they type in http://siteB.com/. What should I do to show page 1 at this address? PHP include? Redirect? Mess with .htaccess?
You could make use of Wordpress' RSS feeds to show the blog posts of site A on site B.
However, from a SEO point of view having the same content on two sites might not be a good idea (duplicate content: http://www.google.com/support/webmasters/bin/answer.py?hl=en&answer=66359).
Install them on two servers and use 1 database.
Is Wordpress MU what you're looking for? It's now in the full release and can be found here http://codex.wordpress.org/Create_A_Network
Tricky, but probably doable, though I'm not sure why you'd want to do it this way, to be honest. You'll need to modify each WordPress install to use some different tables for different things, i.e. site info (base URL, etc.). Note that at runtime you can also use the HTTP_HOST header to determine which "site" you're displaying things for, but I suspect noodling with the tables will get you most of what you want.
See http://wordpress.org/support/topic/share-certain-parts-of-a-wp-database-over-2-domains for some more info.

Categories