WordPress.org

Ready to get started?Download WordPress

Forums

display posts from external blog (19 posts)

  1. Kerim
    Member
    Posted 10 years ago #

    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('http://path-to-blog/include.php'); ?>
    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!

  2. welsper
    Member
    Posted 10 years ago #

    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.

  3. prara
    Member
    Posted 10 years ago #

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

  4. OperaManiac
    Member
    Posted 10 years ago #

  5. Kerim
    Member
    Posted 10 years ago #

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

  6. OperaManiac
    Member
    Posted 10 years ago #

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

  7. Kerim
    Member
    Posted 10 years ago #

    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

  8. <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.

  • OperaManiac
    Member
    Posted 10 years ago #

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

  • OperaManiac
    Member
    Posted 10 years ago #

  • davidchait
    Member
    Posted 10 years ago #

    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
    http://www.chait.net

  • davidchait
    Member
    Posted 10 years ago #

    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

  • davidchait
    Member
    Posted 10 years ago #

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

  • davidchait
    Member
    Posted 10 years ago #

    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

  • Kerim
    Member
    Posted 10 years ago #

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

  • davidchait
    Member
    Posted 10 years ago #

    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
    http://www.chait.net

  • Kerim
    Member
    Posted 10 years ago #

    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.

  • Anonymous
    Unregistered
    Posted 10 years ago #

    OK, so I know I am new to PHP but I followed the directions to use cg-feedread and it does not work for me. I have tried to create a simple feed from one of my categories which I know WP is out putting correctly (http://www.monetarius.net/news/wp-rss2.php?cat=3) but nothing happens. I have tried with .htm and .php they are otherwise the same file.
    http://www.monetarius.net/news/cat_post.php
    http://www.monetarius.net/news/cat_post.htm
    Does anyone know where I went wrong? There was a mention in the documentation that caches were not always working. Is this my problem?
    Any help would be great!

  • davidchait
    Member
    Posted 10 years ago #

    dub -
    Happy to help out. However, there's a lot missing here... ;)
    If 'nothing happens', that usually means the code isn't getting called. If you get errors on the page, that can mean the plugin/hack isn't activated/included.
    I just tested your code that is embedded in the htm version (the false on the end should be removed btw...), and works fine for me. However, without actually seeing your index.php file where the call would normally be made, I can't say what else might be the issue.
    My gut instinct is that "cat_post" has no "include('cg-plugins/feedread.php')" line, and because it doesn't use the WordPress template feedread wouldn't be automagically included as a Plugin. If you want to use it from a non-WP php page, you can, you just need to manually add an include to feedread (and the proper path to it!) yourself.
    That make sense? I'm throwing out blind ideas since I have little to go on. Feel free to fill in blanks if any of the above doesn't point you in the right direction. ;)
    -d
    http://www.chait.net

  • dubhgall
    Member
    Posted 10 years ago #

    OK, I have put an include into the page and pointed to feedread.php. My WordPress blog is in the "news" folder (http://www.monetarius.net/news/index.php) where I had also tried to create the output with cat_post.php.
    What I am actually hoping to do is add the feed to the left side of http://www.monetarius.net/moneyers/index.php I have also made a copy of the same code available at /moneyers/index.htm also I have updated the cat_post.htm and .php with include('wp-content/plugins/cg-plugins/feedread.php') to no result.
    Suggestions?

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.