• I have installed WordPress on my GoDaddy host and had some issues, but finally got it up and running and styled the way I want it. Now I would like to get an expert of my most recent post on my non-wordpress homepage. How would I go about doing that. This is what I currently have for code.

    [huge chunk of code moderated - please use a pastebin or link to file]

    Thanks for any help you can give me

Viewing 4 replies - 1 through 4 (of 4 total)
  • to add content from a WP site to a non-WP site see this article:
    https://www.corvidworks.com/articles/wordpress-content-on-other-pages

    another method, using the WP site’s RSS feed
    https://www.corvidworks.com/articles/easy-feed-reading-with-simplepie

    You can always include the wp config file for the db name, etc…

    // Include config, you'll need to know the path
    include_once('/path/to/wordpress/wp-config.php');
    // Check if it's picked up the constants, if not then something isn't right
    if(!defined('DB_USER') || !defined('DB_PASSWORD') || !defined('DB_HOST')) die('File was not included');
    
    // Do mysql stuff, but now using constants from config file

    ..it’ll also include wp-settings for you (it’s a require at the bottom of the config).. This will include a bunch of extra stuff that you can utilise because the settings file itself includes several files to.

    If you would prefer to stick with your above method (which is proberly more efficient) i’ll happily help where needed. Perhaps if you could give some examples of what is being output by your above code if anything?

    NOTE: I’m not sure posting your database user and password information is a good idea. If that’s current you’d be wise to go change that straight away.
    MODS: Could you asterisk the info until the poster has changed his information?

    Thread Starter adamj3333

    (@adamj3333)

    t31os thanks for the advice. I am actually not sure what I was thinking adding my user/pass in the code, but I will note that from here on out…it has been removed on my page…can you still see it?

    I am not 100% sure what you are suggesting I do, could you be a little more specific? I am pretty new to wordpress.

    Thanks.
    Adam

    Ultimately if you’re looking for a quick easy way, find yourself an RSS script, only need be a basic one, then point it at your post’s feed url, or even better utilise WordPresses RSS class by including the RSS functions file..

    Something along the lines of…

    include('/path/to/rss/class/file/rss.php')
    fetch_rss('URLGOESHERE');

    Can’t remember how i went about it before, been a while since i’ve attempted either.

    stvwlf’s links are good… you can try the method suggested there if you’re not so familiar with code.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add An Exerpt to a Homepage NOT hosted with WordPress’ is closed to new replies.