• I need some help. I have a “static” site running off of WP, and I have a second WP install running as a blog. I’d like the last 5 posts of the blog to appear in the main page of the “static” WP site. This main page is made by simply creating a category with only one post and using the “single category” index.php hack to make only this category appear as the home page. I’ve also created a special “include.php” page with its own stripped-down stylesheet in the WP blog installation. But I don’t know how to “include” this include.php file in the static post listed above. I tried this:
    <?php include(‘https://path-to-blog/include.php&#8217;); ?>
    I put it in the content of the main post, but it didn’t do anything. I guess it ignores PHP code?
    What should I do? I looked all over the forums but I couldn’t find anything. Nothing in the Wiki either. I’m sure it is there, I just couldn’t find it…
    Thanks!

Viewing 15 replies - 1 through 15 (of 18 total)
  • You can only have 1 WP blog per page but infinite blog loops from that 1 blog… sounds like you’re trying to tie two together. Problem is you need the wp-include info, which you provide already from the single cat hack blog. Then you want to bring in info from another blog, but this needs its own wp-include, which doesn’t play well with the original.
    A version or two of WP down the road will allow multiple blogs.

    You can use the RSS feed. There are lots of RSS parsers online. Very simple to install.

    Thread Starter luhmann

    (@luhmann)

    Thanks. That looks good. I also found this one by David Chait:
    https://www.chait.net/index.php?p=85
    I’ll try them both out.

    chait one is tried and tested so prefer it over magpie whcih would need a lot more effort ??

    Thread Starter luhmann

    (@luhmann)

    I can’t get either to work, although I suppose Chait will help me out. Here is my problem with magpie:
    I have Magpie up and running on my site, but I can’t find any documentation about how to make it show the full feed, and not just the feed titles. I’ve tried this code, but it doesn’t work:
    echo $rss->channel[‘title’], “<br>\n”; foreach ($rss->items as $item )
    {
    $title = $item[title];
    $url = $item[link];
    $thecontent = $item[content];
    echo “$title

    <br>$thecontent<br>\n”; }
    Where I wan the “content” to appear, it just says “array”. How do I get it to produce the full content from the feed? I could find no examples of this on the main page, does this mean that magpie can’t do this?
    With Chait, the problem is different. For some reason the content only appears some of the time… Very strange. The rest of the time the content appears as a tooltip.
    I’ll end up with whichever system I can troubleshoot first.

    there was one from jaykul which was a stripped down version of magpie…
    https://jaykul.huddledmasses.org/scripting/news_feed_parser.php

    If you want to hand-walk stuff in CG-Feedread, you certainly can. Just look at what the main code does — it’s pretty simple now.
    On the other hand, it should be working completely automatically. I’ve got test feeds running with full descriptions, partial/clamped descriptions, or links only. I know there are a lot of sites using it successfully now. I haven’t seen any problem feeds as yet since my last update to add the encoded HTML content (probably 10 days ago).
    If you want to send me the feed and the code, I’m sure there’s something simple going on.
    -d
    https://www.chait.net

    Oh, I should have added something… because CG-Feedread specifically uses a caching mechanism to reduce loads, if you don’t tell it not to, or don’t clear out the cache when ‘testing’, any ‘bad data’ will be cached. And it doesn’t just cache the source XML, it caches the resulting HTML, so that I don’t reprocess the feed at all until it refreshes from source data.
    You can ‘temporarily’ for testing purposes set the cachename arg to be an empty string, and that’ll let it reprocess each time.
    I’m working away on some revisions right now, will post as soon as I’ve got the new version up on my site for download.
    -d

    Okay, the new version of CG-Feedread is up. Now supports installation as a Plugin, other minor improvements.
    -d

    eeek! Okay, if you happened to actually be one of the few people who grabbed a version in the last few hours, go get it again. ??
    Turned out I completely disabled the caching mechanism, causing slow pageloads as it was live-grabbing all feeds.
    -d

    Thread Starter luhmann

    (@luhmann)

    Caching of bad data seems likely to be the problem I was having.

    Cool, so is it working correctly now? Trying to stay on top of it where I made so many little changes here and there… want to make sure I only fixed things, didn’t break anything… ??
    -d
    https://www.chait.net

    Thread Starter luhmann

    (@luhmann)

    I haven’t had time to test out the updated plugin. I’m still using Magpie. I generally do this stuff on the weekends, so it may be next weekend before I have time to test the updated plugin. I will test it, however, as I’d prefer to use something that seems better integrated into WP. And at some point I will write something up on my blog about how I’ve set up this site.

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘display posts from external blog’ is closed to new replies.