FRIHOSTFORUMSSEARCHFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Displaying Wordpress blog posts in another website.

 


tingkagol
I have a really quick question.

How do you show your wordpress blog posts in another website?

I want wordpress to manage all my posts, but I want to display these posts in another website of mine. My experience with CutePHP was to put the "include" command in one of my tables to call for the appropriate news php file, but I don't really know how it works with wordpress.

Thank you to whoever's kind enough to help me.
rvec
best way (according to #wordpress on freenode.net) would be to get the rss feed and parse it with simplexml. That way you'd have full control of how to display it, and you could use it on other sites also (not the case with loading part of wortdpress or a db query).
tingkagol
I have zero knowledge in XML. lol

Can you provide a link? Or are there already guides available to do this?

Thanks.
rvec
do you know anything about php?
http://nl.php.net/simplexml

else you could try this:
http://www.rss-info.com/en_rssinclude-simple.html

or search for "rss on your website" on google, there are some other things like that which make a small script for you to put on your site.

The PHP script allows you to really put the content of the rss in your site and fully theme it, but the other is much easier (copy/paste).
tingkagol
I don't know much about php either (well, probably just the include syntax, but still).

But thanks for the links. I think I'll see what I could do with the 2nd link you gave me. The 1st one's still confusing to me. Smile

EDIT:
2nd link didn't work. I mean, I tried putting the generated script on my site, but it displayed this error:
Code:
Warning: readfile() [function.readfile]: URL file-access is disabled in the server configuration in /usr/home/tingkago/domains/piktos.frih.org/public_html/home.php on line 41

Warning: readfile(http://www.rss-info.com/rss2.php?integration=php&windowopen=1&rss=http%3A%2F%2Fwww.piktos.frih.org%2Fwordpress%2F&number=10&width=400&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&rssbgcol=FFFFFF&showrsstitle=1&showtext=1) [function.readfile]: failed to open stream: no suitable wrapper could be found in /usr/home/tingkago/domains/piktos.frih.org/public_html/home.php on line 41
rvec
hmm seems like that php version uses some functions that are dissabled on frihost. You could try the iframe or javascript version. I am sure those will work.

or you could try this instead of the php script:
Code:
<?php
$url = "http://www.rss-info.com/rss2.php?integration=php&windowopen=1&rss=http%3A%2F%2Fwww.piktos.frih.org%2Fwordpress%2F&number=10&width=400&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&rssbgcol=FFFFFF&showrsstitle=1&showtext=1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_Ex--ec($ch);//remove the -- there, I had to put this in because of frihost security
curl_close($ch);


Don't forget to replace the url with the one you got in your version of the php script(I copied this one from your script so it's probably the same).
tingkagol
rvec wrote:

Code:
<?php
$url = "http://www.rss-info.com/rss2.php?integration=php&windowopen=1&rss=http%3A%2F%2Fwww.piktos.frih.org%2Fwordpress%2F&number=10&width=400&ifbgcol=FFFFFF&bordercol=FFFFFF&textbgcol=FFFFFF&rssbgcol=FFFFFF&showrsstitle=1&showtext=1";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_Ex--ec($ch);//remove the -- there, I had to put this in because of frihost security
curl_close($ch);

I noticed the lack of "?>" at the end, but that didn't work, either.

Anyway, the iframe script worked. Smile


I'm still interested in learning simplexml. Any tips on what commands I should learn first?

Thanks for all the help.
rvec
?> is optional at the end of a php file, I stopped using it after aI found that out Razz

You should start with the basics of php, and when you can make your own functions and understand those you can start with things like simplexml and mysql.
http://www.php.net/manual/en/
that's all the info about php you could wish for Smile
Related topics

Wordpress blog on ypur website
wordpress recent posts help
The best way to include a new Wordpress blog for SEO.....
Anyone please give me some idea about wordpress
Wordpress blog intergration problem!

50FRIH for making me correctly post in Wordpress Blog.
Integrate Wordpress blog with SMF forum
How do you delete blog posts?
What is the difference between a blog and a website?
HIRE ME TO ADVERTISE/BLOG ABOUT YOUR WEBSITE FOR 1$!!!!!!!:)

Deleting Blog Posts
Carl's Start-to-Finish Professional Website Tutorial
wordpress help
Yet another blog, and an achievement of sorts.
Uploading A Viewable Video To Website
Reply to topic    Frihost Forum Index -> Scripting -> Website Software

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.