WordPress.org

Ready to get started?Download WordPress

Forums

Intigrate WP Multisite with website (11 posts)

  1. philaecom
    Member
    Posted 1 year ago #

    Hi I'm trying to do what this person had previously asked but no one answered.

    http://wordpress.org/support/topic/integrating-wordpress-multisite-with-your-website?replies=3

  2. Same answer as that guy got.

    But... really it's a hassle.

  3. philaecom
    Member
    Posted 1 year ago #

    it says it won't work with multi-site. I alreayd have multisite.

  4. The trick is you have to tell WP which blog to use the content from, via switch_to_blog(), which isn't recommended nor does it work well.

    Why do you have to 'integrate' though? What are you actually trying to do?

  5. philaecom
    Member
    Posted 1 year ago #

    It is not working for me. I have http://blog.mysite.com/news

    The news blog has ID of blog 2 which i lookedup in the wordpress database under table wp_blogs. My main site i have a page like this http://www.mysite.com/home.php I have the code below which is not working as expected and is redirecting me to http://blog.mysite.com/

    I need to stay at http://www.mysite.com/home.php I want to take the title of my blog post and display it on http://www.mysite.com/home.php Thus I need to be able to integrate my wordpress with my current site.

    <?php
        require( '/var/www/vhost/blog/wp-load.php' );
    
    define('WP_USE_THEMES', false);
    switch_to_blog(2);
    
    echo 'You switched to blog 2';
    
    echo 'new content outside WordPress';
    
    echo 'some wordpresss functions used here'; 
    
    ?>
  6. philaecom
    Member
    Posted 1 year ago #

    Sorry updated code

    <?php
    
    require( '/var/www/vhost/blog/wp-load.php' );
    require( '/var/www/vhost/blog/wp-includes/ms-functions.php' );
    
    define('WP_USE_THEMES', false);
    switch_to_blog(2);
    
    echo 'You switched to blog 2';
    
    echo 'new content outside WordPress';
    
    echo 'some wordpresss functions used here'; 
    
    ?>
  7. philaecom
    Member
    Posted 1 year ago #

    i'm seeing 302 in my access log not sure why it is redirected to the blog when i want to keep it on http://www.mysite.com/home.php

  8. I need to stay at http://www.mysite.com/home.php I want to take the title of my blog post and display it on http://www.mysite.com/home.php Thus I need to be able to integrate my wordpress with my current site.

    Why?

    I'm not asking to be a pest, I really do want to know why. We may be working the wrong way around the problem.

    WHY do you 'need' to stay on that URL?

  9. philaecom
    Member
    Posted 1 year ago #

    The reason I need to stay on the page and not have it redirect me when I try to use the wordpress functions is because that page is my home page for my site. I want to just display the blog post header and then when the user clicks the blog post head it will then take them to http://blog.mysite.com/news/

    If I wanted them to go to http://blog.mysite.com/ I would have just installed wordpress so it is in my TLD http://www.mysite.com

    I'm trying to just use a small part of my blog on my main site aka the post header to direct them to my main site.

  10. What's special about mysite.com that it can't be WP, for one?

    For another, you'd probably be better off using RSS to pull in post titles and parse that instead.

  11. philaecom
    Member
    Posted 1 year ago #

    Hi,

    With mysite.com is going to be a home grown CMS. Yes I know you going to ask why not just use wordpress as your CMS. We have other things then just blogs that we host. For example we use OJS to host some various in house journals that are published. mysite.com is going to have a MVC framework and a user authencation system. That we plan to tie into wordpress and ojs. Also possibly other systems that we might integrate it with. We also have a proxy system that we are integrating.

    OJS - http://pkp.sfu.ca/?q=ojs

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.