• 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 3 replies - 16 through 18 (of 18 total)
  • 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 (https://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.
    https://www.monetarius.net/news/cat_post.php
    https://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!

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

    OK, I have put an include into the page and pointed to feedread.php. My WordPress blog is in the “news” folder (https://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 https://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?

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