Displaying articles from a wordpress site on a non-wordpress site

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.

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

Read More

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?

Related posts

Leave a Reply

2 comments

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

    This assumes that the WordPress blog is on the same server as the non-Wordpress content and you can reference wp-load.php


    WordPress content on non-Wordpress pages on remote domain

    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:

    To get the RSS feed for a particular category, use something like

    http://www.example.com/?cat=42&feed=rss2

    http://example.com/category/categoryname/feed

    More here:

  2. If the other pages are located on the same server you can do this by loading the wp-load.php file

    First add this to the top of the page to load wp-load.php

    <?php
    // Include WordPress 
    define('WP_USE_THEMES', false);
    require('./wordpress/wp-load.php');
    query_posts('showposts=1');
    ?>
    

    Then you can loop all the content via:

    <?php while (have_posts()): the_post(); ?>
    <h2><?php the_title(); ?></h2>
    <?php the_excerpt(); ?>
    <p><a href="<?php the_permalink(); ?>">Read more...</a></p>
    <?php endwhile; ?>
    

    Checkout this link: The Loop (WordPress Codex)