Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    Same answer as that guy got.

    But… really it’s a hassle.

    Thread Starter philaecom

    (@philaecom)

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

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    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?

    Thread Starter philaecom

    (@philaecom)

    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'; 
    
    ?>
    Thread Starter philaecom

    (@philaecom)

    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'; 
    
    ?>

    Thread Starter philaecom

    (@philaecom)

    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

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    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?

    Thread Starter philaecom

    (@philaecom)

    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.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    🏳️‍🌈 Advisor and Activist

    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.

    Thread Starter philaecom

    (@philaecom)

    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

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Intigrate WP Multisite with website’ is closed to new replies.