WordPress.org

Ready to get started?Download WordPress

Forums

Including a WP-generated page into a page *outside* WP (5 posts)

  1. frankiejr
    Member
    Posted 9 years ago #

    Hello,

    I've searched the forums, but couldn't seem to find any answers to my problem. I'm posting this in hopes that I don't have to move to MoveableType 2.661 (page rebuilds...ugh!)

    This is a quick rundown of what I'm doing:

    1. Install 4 different instances of WordPress in different directories, similar to this:
      • domain.com/reviews/
      • domain.com/news/
      • domain.com/fiction/
      • domain.com/weird/
    2. Modify the templates so they show only the post...no other page elements at all.
    3. Use a page (domain.com/index.php) and php includes to pull all the different "front pages" (with the 2 newest posts per blog) into one page.

    I've done this with MT2.661 before without issue. I'm not sure if this is because that version of MT built static pages that are easy to include.

    When I do this in WP, it seems like PHP just stops generating the page after the first PHP include. Nothing after the WP code shows up.

    I don't know if I'm going about this the wrong way, either. This site needs to be done by May 5 (7 days from now) and I was really hoping I could find a solution. If anyone has an answer or an alternative answer, please reply to this.

    Thanks for your help!
    .frankiejr

  2. Joshua Sigar
    Member
    Posted 9 years ago #

    Are you stuck on step 3 of yours? How you do it exactly?

    Since you have 4 installation, all I can think of pulling all 4 blogs content to domain.com/index.php is by utilizing a feedreader.
    A feedreader will grab the content of all 4 blogs and display them in one place: domain.com/index.php

    I don't know why you decided to have 4 installation. You can have only one installation, and pull up different categories in different pages.

  3. frankiejr
    Member
    Posted 9 years ago #

    Thanks for replying so quickly.

    I'd thought of that, but the real reason I wanted to do this was for the directory structure. The URLs above aren't exactly accurate; they'll work that way since they're symlinks, but the real URLs I was planning on using are reviews.domain.com, news.domain.com, etc.

    I think I might do it using the category method you mentioned and figure out an .htaccess solution later on down the road for the directory structure. I think the nit-pick in me is gonna have to take a back seat, at least for now.

    I LOVE WordPress, and I know that multi-blog support is going to be coming in a release some day. If I start with it now, I'll be able to convert to a newer version easily when that's available. Plus, using MT 2.661, the static pages will grow to an unmanageable size some day (probably sooner than later). Not something I want to deal with.

    Now all I need to do is find some quick and dirty tutorials on how to separate my index page into categories. Long night, no sleep...

    Thanks again!
    .frankiejr

  4. nik
    Member
    Posted 9 years ago #

    You dont need 4 copies of WP installed, that means you will have to login to whatever install you want to put your new article into, wont have centralised drafts and post editing etc.

    What you should do is install WordPress once. Setup 4 categories like how you want them. This is simple enough. Drop in a couple of test posts into each category.

    To get the URLs for each section the way you want it, add rewrite rules to your .htaccess file for each one, eg:

    Redirect permanent /archives/categories/reviews /categories

    or you can do this in options -> permalinks and setting the category base to just /

    On your main page, the reason it is stopping is because of PHP errors. You cant just include the pages since the WP headers that define all variables are not included. For your main themes index.php, you will need to call the database directly and pull the posts, or you can track down the WP functions that will pull posts from a certain category for you and use a for loop (twice) as opposed to a while loop. I cant help you much on that sorry.

  5. frankiejr
    Member
    Posted 9 years ago #

    alphaoide & nik,

    Just wanted to say thanks to both of you again. Between what you both said here and what alphaoide posted here, I'm already on my way to getting it set up.

    Looks like I might be able to make the deadline after all, as long as I don't really sleep much 'til then...

    .frankiejr

Topic Closed

This topic has been closed to new replies.

About this Topic