WordPress.org

Support

Support » Miscellaneous » Show specific category posts on a different website

Show specific category posts on a different website

  • Hi,
    I have my blog set up at http://blog.domain.net and my personal website at http://www.domain.net. The blog is working fine.

    Now, I have a specific category (with ID = 10) that represents news that are displayed on the front page of my website. I want the latest 5 posts of this single category do be displayed on the front page of the website. Which is not using any code from WordPress.

    Basically, I’m reading the DB parameters from the wp-config.php file and pulling the posts from the DB like this:

    $news = mysql_query(“SELECT p.post_date_gmt, p.post_content, p.guid, p.comment_count FROM wp_posts AS p INNER JOIN wp_term_relationships AS tr ON p.ID = tr.object_id WHERE tr.term_taxonomy_id = 10 ORDER BY post_date_gmt DESC LIMIT 0,5”);
    while ($row = mysql_fetch_array($news)) {
    // CODE
    }

    This is working, the only problem is the post formatting. There are no paragraphs in the post and the smiles are not replaced. These are the only 2 things I’ve noticed so far, bold text, italic text, images and stuff like that, their HTML is in the post so no problems here. But the paragraphs do not show at all, they are not even saved in the DB.

    Can someone help me fix this?

Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Show specific category posts on a different website’ is closed to new replies.
Skip to toolbar