Forums

integrate blog into current website? (10 posts)

  1. vivithemage
    Member
    Posted 4 months ago #

    I only use my blog to post little updates, i'd like to 'feed' or integrate it into the home page, so that posts can be seen on the home page, in a little box.

    Would this pretty much do it?

    http://codex.wordpress.org/Integrating_Wordpress_with_Your_Website

    I have the site up and running, I just want to be able to throw in some code, and have it 'pull' from my blog if possible.

  2. esmi
    Member
    Posted 4 months ago #

    If you already have a .php driven site, yes.

  3. vivithemage
    Member
    Posted 4 months ago #

    It is PHP driven.

    Would that link work for me?

  4. valendesigns
    Member
    Posted 4 months ago #

    Is the home page wordpress too?

  5. vivithemage
    Member
    Posted 4 months ago #

    It's a website - > http://vivicalhosting.com/

    I plan to move the box around, and put the blog 'feed' into it. It won't be HUGE (300x200 or so), I just want room to show updates/news and what have you, from the blog.

  6. vivithemage
    Member
    Posted 4 months ago #

    Any ideas?

  7. alchymyth
    Member
    Posted 4 months ago #

    you could use an <iframe> in your webpage and point it to the 'blog'.
    you'll proably need to make a custom wordpress theme just with the 'index.php' without header, footer, sidebars; only 300px or so wide.

  8. vivithemage
    Member
    Posted 4 months ago #

    I thought there would be an easy way to just pull the data from the latest blog.

    wouldn't an iframe basically put the blog inside of a frame, the FULL blog (anything at blog.vivicalhosting.com?).

  9. TheLight
    Member
    Posted 4 months ago #

    you can try adding the following code to your websites homepage


    <?php
    $wp_post_query = mysql_query("select wp.ID, wp.post_content, wp.post_title, wp.post_date, wp.post_author, wp.comment_count FROM wpb_posts wp LEFT JOIN wpb_term_relationships wtr ON wp.ID=wtr.object_id WHERE wp.post_status = 'publish' ORDER BY wp.post_date desc limit 2"); // change limit to show more posts

    while ($wp_post = mysql_fetch_array($wp_post_query)) {
    $code_array = array(
    "#\[.+\]#siU",
    "#\<.+\>#siU"
    );
    $postContent = preg_replace($code_array, '',$wp_post['post_content']);
    //$postContent = preg_replace("/[^ ]*$/", '', substr($postContent, 0, 110)); // limits content of each post to 110 chars
    $postContent = preg_replace("/[^ ]*$/", '',$postContent);
    echo '<h4>' . $wp_post['post_title'] . '</h4>';
    echo '<div class="postContent">' . $postContent . '...</div>';
    }
    ?>

    tested with WP2.8 and as far as I remember with 2.6

    hope it helps

  10. vivithemage
    Member
    Posted 4 months ago #

    Anything that I should add/change?

Reply

You must log in to post.

About this Topic

Tags

No tags yet.