在非wordpress网站上显示来自wordpress网站的文章 [英] Displaying articles from a wordpress site on a non-wordpress site
问题描述
最简单的方法是将发布在wordpress网站上(来自特定类别)的文章条目显示到另一个用PHP/MySQL构建的非wordpress网站上.
What is the easiest way to display articles entries posted on a wordpress site (from a particular category) onto another non-wordpress site that is built in PHP/MySQL.
我了解wordpress使用MySQL,因此从理论上讲我可以通过PHP连接到数据库并直接提取内容(如果我能弄清所使用的模式)
I understand wordpress uses MySQL so in theory I could connect via PHP to the database and pull the content directly if I can figure out the schema used
我知道我可以获得RSS提要-是否有可用的解析器来获取所有文章内容,包括图像等?
I know I can get an RSS feed - is there a parser available that I could use to get all article content including images etc?
推荐答案
相同域中的非Wordpress页面上的Wordpress内容
这是一种非常耗费数据库的方法,因为它几乎在后台加载了整个Wordpress,但是它很容易并且有据可查:
Wordpress content on non-Wordpress pages in same domain
This is a very database-intensive method as it loads almost the entirety of Wordpress behind the scenes, but it's easy and well-documented:
Display Wordpress content outside of your blog
这假定Wordpress博客与非Wordpress内容位于同一服务器上,并且您可以引用wp-load.php
This assumes that the Wordpress blog is on the same server as the non-Wordpress content and you can reference wp-load.php
将内容联合发布到远程域的最简单方法是使用 MagpieRSS 解析RSS feed.
One of the simplest simplest methods to syndicate content onto a remote domain is to parse the RSS feed using MagpieRSS.
有大量可用的代码示例:
There are a large number of code samples available:
- http://magpierss.sourceforge.net/links.shtml
- http://www.technologytricks.com/rss-read-php-magpierss /
- http://www.oneandoneis2.org/MagpieHowTo.php
- http://magpierss.sourceforge.net/links.shtml
- http://www.technologytricks.com/rss-read-php-magpierss/
- http://www.oneandoneis2.org/MagpieHowTo.php
要获取特定类别的RSS提要,请使用
To get the RSS feed for a particular category, use something like
http://example.com/category/categoryname/feed
更多信息在这里:
这篇关于在非wordpress网站上显示来自wordpress网站的文章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!