WordPress.org

Ready to get started?Download WordPress

Forums

improved include page & multisite (4 posts)

  1. image-for-you
    Member
    Posted 1 year ago #

    Hello everybody.

    I already read this:
    http://wordpress.org/support/topic/plugin-improved-include-page-how-to-include-page-to-an-other-multiblog-site?replies=9

    but I'm not familiar with php coding and would like to ask what code exactly I have to write. Following Situation:

    I have a multisite wordpress installation with these plugins installed:
    - improved include page (to embed content of pages into other pages)
    - Exec-PHP (to be able to use php code in pages / posts)

    Now I want to embed the content from a static page (page id 4) which is inside the multisite "testblog" (id 2) into a static page of another multisite.

    I tried to use this code but nothing happened:
    <?php switch_to_blog($testblog); iinclude_page(4); ?>

    What code do I have to write to embed "'page-id4' from 'testblog'" into a page of another mulisite?

    Thank you so much - maybe someone can help.
    Kind Regards
    Michael

  2. <?php
    $testblog = X;
    switch_to_blog($testblog);
    include_page(4);
    ?>

    Note: The X above has to be a valid site number.

    Oh and you have to restore the current blog when you're done. But all this is a bad idea anyway. It's not a great idea to pull in the context of another post like this. Why not just redirect to it?

  3. image-for-you
    Member
    Posted 1 year ago #

    Thank you for reply Ipstenu!

    I cannot use "redirect" because the user must stay in the multisite. If I redirect the user, he will see another site design. Each multisite uses the same theme but ohter design (colors and header-logo).

    That's why I only want to show the TEXT of page#4 from multisite #2 inside the page#2 of mulisite#3. Like a text stream.

    Unfortunately your code did not work.

    Inside a multisite ist works with plugin "Improved Include Page".
    For example I can show the text-content of site#4 in site#5 with this phrase inside the page: <?php iinclude_page(4); ?>
    This works fine. Please see SCREENSHOT

    But I need a solution to geht the TEXT CONTENT from a different multisite page into another multisite page.

    Any Idea? Thank you so much!
    Kind regards
    Michael

  4. You'll need to write a real DB call for that, and there isn't yet a plugin that can do it for you.

Topic Closed

This topic has been closed to new replies.

About this Topic