<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>MarcelDoornbos.com</title>
	<atom:link href="http://www.marceldoornbos.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marceldoornbos.com</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Fri, 24 Oct 2008 16:35:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
	<language>en</language>
			<item>
		<title>My 3 Days in Belgium!</title>
		<link>http://www.marceldoornbos.com/2008/10/my-3-days-in-belgium/</link>
		<comments>http://www.marceldoornbos.com/2008/10/my-3-days-in-belgium/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 16:35:48 +0000</pubDate>
		<dc:creator>Marcel Doornbos</dc:creator>
		
		<category><![CDATA[Fun]]></category>

		<category><![CDATA[Antwerpen]]></category>

		<category><![CDATA[Armani]]></category>

		<category><![CDATA[Belgium]]></category>

		<category><![CDATA[Blog]]></category>

		<category><![CDATA[Doornbos]]></category>

		<category><![CDATA[Holiday]]></category>

		<category><![CDATA[Jacket]]></category>

		<category><![CDATA[Marcel]]></category>

		<category><![CDATA[Nike]]></category>

		<category><![CDATA[Puma]]></category>

		<category><![CDATA[Ramada Plaza]]></category>

		<category><![CDATA[The Netherlands]]></category>

		<guid isPermaLink="false">http://www.marceldoornbos.com/?p=53</guid>
		<description><![CDATA[Hello People, 
As a few of you may know, I&#8217;ve been to Belgium this week. To be a bit more precise, i&#8217;ve been to &#8220;Antwerpen&#8221;. I staid there in a Hotel called &#8220;Ramada Plaza&#8221; which is Very nice. so here will be a kind of Traveling report.  
The Driving to it.
We didn&#8217;t want to go [...]]]></description>
			<content:encoded><![CDATA[<p>Hello People, </p>
<p>As a few of you may know, I&#8217;ve been to Belgium this week. To be a bit more precise, i&#8217;ve been to &#8220;Antwerpen&#8221;. I staid there in a Hotel called &#8220;Ramada Plaza&#8221; which is Very nice. so here will be a kind of Traveling report. <img src='http://www.marceldoornbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><strong>The Driving to it.</strong></p>
<p><strong></strong>We didn&#8217;t want to go with the train because that&#8217;s pretty Buzy in the what we call in dutch &#8220;Spits&#8221;. So we went with the Car. After a few times in the trafic jam and 3 á 4 hours of driving on a very long road we were in Antwerpen. We were driving through a block with only the same houses and only trams moving and cars. We read the instructions from the hotel and after a few times driving back we found the hotel.</p>
<p><strong>The hotel.</strong></p>
<p><strong></strong>The Hotel looked Awesome. It was like a big building from only Glass. Like those big New York buildings. where you don&#8217;t see any Stone from the outside. We went in and we saw a really Modern and Business type of lounge. There was also a Bar, Sauna, Fitness, Restaurant and some more i don&#8217;t remember. We checked in and went to our rooms with 1 of the 3 elevators. It was on the 6th floor though. So we went in and saw a nice good looking room with a Flatscreen HD Tv offcourse :). So you can gues the first thing we were going to look was the TV. we could watch some Belgium channels and some French, italian, german and offcourse some of our own Dutch ones. So after relaxing a bit we went to the Shopping center in Antwerpen. </p>
<p>The First thing about that: IT&#8217;s Expensive <img src='http://www.marceldoornbos.com/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /> There are alot of Brand shops from brands like Nike, Armani, Puma, etc.. i just went to some stores i didn&#8217;t knew or to some with nice clothes. After a while i found a nice jack and bought it. So now i hope i will still like it next week. else I can just choose a different one. </p>
<p><strong>Belgium Things.</strong></p>
<p><strong></strong>Well After beeing there I still thought Belgium is Weird. In the netherlands they always make jokes about Belgian people and some think belgian people are stupid (The belgiums do the same with us :D) But now i really saw some of those things. Like at first in The Netherlands we have traffic rules that the Traffic lights at a crossing go on green when you can savely walk to the other side. we do that with giving the walking people the time to walk by giving them green light and the cars who have to go to the side of where people are walking get Red light. But in Belgium they do all traffic lights at the same time. So when the people who walk have green, the cars have green too. So that means you still have to look when there comes a Car. So it&#8217;s more save to walk when the light is Red. <img src='http://www.marceldoornbos.com/wp-includes/images/smilies/icon_neutral.gif' alt=':|' class='wp-smiley' /> that&#8217;s major weird thing i found out. </p>
<p>Well I did much more things there but i&#8217;m not going to tell that.</p>
<p>Marcel Doornbos</p>
]]></content:encoded>
			<wfw:commentRss>http://www.marceldoornbos.com/2008/10/my-3-days-in-belgium/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Part 5: How To Display Wordpress posts on your PHP site.</title>
		<link>http://www.marceldoornbos.com/2008/10/part-5-how-to-display-wordpress-posts-on-your-php-site/</link>
		<comments>http://www.marceldoornbos.com/2008/10/part-5-how-to-display-wordpress-posts-on-your-php-site/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 09:19:46 +0000</pubDate>
		<dc:creator>Marcel Doornbos</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[School]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[ASC]]></category>

		<category><![CDATA[Creation]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[DESC]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Display]]></category>

		<category><![CDATA[Frontpage]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[How]]></category>

		<category><![CDATA[How To]]></category>

		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Index]]></category>

		<category><![CDATA[Loop]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Order By]]></category>

		<category><![CDATA[Outside]]></category>

		<category><![CDATA[Pagerank]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Self]]></category>

		<category><![CDATA[Site]]></category>

		<category><![CDATA[To]]></category>

		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://www.marceldoornbos.com/?p=43</guid>
		<description><![CDATA[Welcome to the Final Part 5: How To Display Wordpress posts on your PHP site
This is the last part of the tutorial. Here you can see the Final codes. and you can use the See the final result on my demo test page.
The final Codes:
I will now post the final codes of the index.php and [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Welcome to the Final Part 5: How To Display Wordpress posts on your PHP site</strong></p>
<p>This is the last part of the tutorial. Here you can see the Final codes. and you can use the See the final result on my demo test page.</p>
<p><strong>The final Codes:</strong></p>
<p><strong><span style="font-weight: normal;">I will now post the final codes of the index.php and the wpconf.php file. You may use the Codes in it but please link back to my blog if you use it. I would like that. Well here are the codes and i hope i helped you a bit with it.</span></strong></p>
<p><strong><strong>Index.php:</strong></strong></p>
<pre class="syntax-highlight:php">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Test Page Title&lt;/title&gt;
&lt;?php require(&quot;wpconf.php&quot;); ?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
 // keeps getting the next row until there are no more to get
 while($row = mysql_fetch_array( $result )) {   ?&gt; 

&lt;a href=&quot;&lt;?php echo $row[&#039;guid&#039;]; ?&gt;&quot;&gt;&lt;?php echo $row[&#039;post_title&#039;]; ?&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Post Date: &lt;?php echo $row[&#039;post_date_gmt&#039;]; ?&gt;
&lt;hr&gt; 

&lt;?php
}
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong><strong>wpconf.php</strong></strong></p>
<pre class="syntax-highlight:php">
&lt;?php

 // Make a MySQL Connection
mysql_connect(&quot;localhost&quot;, &quot;DatabaseUser&quot;, &quot;DatabasePassword&quot;) or die(mysql_error());
mysql_select_db(&quot;DatabaseName&quot;) or die(mysql_error());

// Get all the data from the &quot;wp_posts&quot; table
$result = mysql_query(&quot;SELECT * FROM wp_posts WHERE post_type=&#039;post&#039; ORDER BY ID DESC LIMIT 15&quot;)
or die(mysql_error());

?&gt;
</pre>
<p><strong><span style="font-weight: normal;">Thank you for reading my tutorial and i hope you are happy with it. Take care and keep coding ;) Also keep designing for those who do that. </p>
<p><strong>The end of Part 5, And the end of the Tutorial.</strong></span></p>
<p></strong><script type="text/javascript">
digg_url = 'http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/';
</script><br />
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<ul>
<li><a href="http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 1: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-2-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 2: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-3-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 3: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-4-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 4: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-5-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 5: How To Display Wordpress posts on your PHP site.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.marceldoornbos.com/2008/10/part-5-how-to-display-wordpress-posts-on-your-php-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Part 4: How To Display Wordpress posts on your PHP site.</title>
		<link>http://www.marceldoornbos.com/2008/10/part-4-how-to-display-wordpress-posts-on-your-php-site/</link>
		<comments>http://www.marceldoornbos.com/2008/10/part-4-how-to-display-wordpress-posts-on-your-php-site/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 08:42:33 +0000</pubDate>
		<dc:creator>Marcel Doornbos</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[School]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[ASC]]></category>

		<category><![CDATA[Creation]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[DESC]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Display]]></category>

		<category><![CDATA[Frontpage]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[How]]></category>

		<category><![CDATA[How To]]></category>

		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Index]]></category>

		<category><![CDATA[Loop]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Order By]]></category>

		<category><![CDATA[Outside]]></category>

		<category><![CDATA[Pagerank]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Self]]></category>

		<category><![CDATA[Site]]></category>

		<category><![CDATA[To]]></category>

		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://www.marceldoornbos.com/?p=40</guid>
		<description><![CDATA[Welcome to Part 4: How To Display Wordpress posts on your PHP site
I will continue where i stoped at Part 3. So if you did just come onto this page and you didn&#8217;t read Part 3 Go to the bottom of this post and click on Part 3.
Get info in a Template:
Now the database send [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Welcome to Part 4: How To Display Wordpress posts on your PHP site</strong></p>
<p>I will continue where i stoped at Part 3. So if you did just come onto this page and you didn&#8217;t read Part 3 Go to the bottom of this post and click on Part 3.</p>
<p><strong>Get info in a Template:</p>
<p><span style="font-weight: normal;">Now the database send all information to the wpconf.php and the index.php gets all info from the wpconf.php file we need to put the right php code into the index.php file. We do that by using these kind of codes: </p>
<pre class="syntax-highlight:php">
&lt;?php echo $row[&#039;rowname&#039;]; ?&gt;
</pre>
<p> </span></strong></p>
<p><strong>Which codes we need:</p>
<p></strong>in Part 1 you have thought about which information you want on your php page. Now we know how to get it there we need to create that. We do that by the previous code, we replace the &#8220;rowname&#8221; with the name of the info you want to be added at that place. And example is the &#8220;post_title&#8221;:</p>
<pre class="syntax-highlight:php">
&lt;?php echo $row[&#039;post_title&#039;]; ?&gt;
</pre>
<p><strong>Getting the Row info till it&#8217;s empty:</p>
<p></strong>Before we add the previous codes to the template we will need to specify which part of the template php needs to repeat till the MySQL database has no entry&#8217;s anymore. We do that with the following code:</p>
<pre class="syntax-highlight:php">
&lt;?php
 // keeps getting the next row until there are no more to get
 while($row = mysql_fetch_array( $result )) {	?&gt;

//The Content//

&lt;?php
}
?&gt;
</pre>
<p>The content between it can be replaced by a div or many Div&#8217;s. It can have a total Post entry template in it. We will keep it simple and we will only add a &lt;hr&gt; between the entry&#8217;s (a horizontal line). So now the index.php will look like:</p>
<pre class="syntax-highlight:php">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Test Page Title&lt;/title&gt;
&lt;?php require(&quot;wpconf.php&quot;); ?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;?php
 // keeps getting the next row until there are no more to get
 while($row = mysql_fetch_array( $result )) {	?&gt;

//The Content//
&lt;hr&gt;

&lt;?php
}
?&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Adding the Row codes: </p>
<p></strong>Now we have specified which part of the code PHP needs to repeat till it&#8217;s empty we will add the Info into it. In this way php will display the info Per post. So the exact link to the post the author from that post, etc.. We can now add all the info into it. For example: </p>
<pre class="syntax-highlight:php">
&lt;body&gt;
&lt;?php
 // keeps getting the next row until there are no more to get
 while($row = mysql_fetch_array( $result )) {	?&gt;

&lt;a href=&quot;&lt;?php echo $row[&#039;guid&#039;]; ?&gt;&quot;&gt;&lt;?php echo $row[&#039;post_title&#039;]; ?&gt;&lt;/a&gt;&lt;br&gt;&lt;br&gt;
Post Date: &lt;?php echo $row[&#039;post_date_gmt&#039;]; ?&gt;
&lt;hr&gt;

&lt;?php
}
?&gt;
&lt;/body&gt;
</pre>
<p>Offcourse you can add multiple other Rows. I showed only and example of it. Just try it out and you will see that it&#8217;s very easy to create.</p>
<p>My working example is in the demo directory at:<br />
<strong>Demo php page:</strong> http://www.marceldoornbos.com/demo/site/index.php<br />
<strong>Demo Blog:</strong> http://www.marceldoornbos.com/demo/blog<br />
(For the blog i used Wordpress 2.6.2, The latest version at this moment)</p>
<p><strong>You can see the result there. </strong></p>
<p>The Final 5th part is the Full Code of the index.php and wpconf.php File.<br />
so if you want ot see the full code go to part 5. </p>
<p><strong>The end of Part 4</strong></p>
<p><script type="text/javascript">
digg_url = 'http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/';
</script><br />
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<ul>
<li><a href="http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 1: How To Display Wordpress posts on your PHP site.</a> </li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-2-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 2: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-3-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 3: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-4-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 4: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-5-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 5: How To Display Wordpress posts on your PHP site.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.marceldoornbos.com/2008/10/part-4-how-to-display-wordpress-posts-on-your-php-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Part 3: How To Display Wordpress posts on your PHP site.</title>
		<link>http://www.marceldoornbos.com/2008/10/part-3-how-to-display-wordpress-posts-on-your-php-site/</link>
		<comments>http://www.marceldoornbos.com/2008/10/part-3-how-to-display-wordpress-posts-on-your-php-site/#comments</comments>
		<pubDate>Fri, 17 Oct 2008 08:12:55 +0000</pubDate>
		<dc:creator>Marcel Doornbos</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[School]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[ASC]]></category>

		<category><![CDATA[Creation]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[DESC]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Display]]></category>

		<category><![CDATA[Frontpage]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[How]]></category>

		<category><![CDATA[How To]]></category>

		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Index]]></category>

		<category><![CDATA[Loop]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Order By]]></category>

		<category><![CDATA[Outside]]></category>

		<category><![CDATA[Pagerank]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Self]]></category>

		<category><![CDATA[Site]]></category>

		<category><![CDATA[To]]></category>

		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://www.marceldoornbos.com/?p=37</guid>
		<description><![CDATA[Welcome to Part 3: How To Display Wordpress posts on your PHP site
I will continue where i stoped at Part 2. So if you did just come onto this page and you didn&#8217;t read Part 2 Go to the bottom of this post and click on Part 2.
Ordering The MySQL Entrys:
 
In the previous part [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Welcome to Part 3: How To Display Wordpress posts on your PHP site</strong></p>
<p>I will continue where i stoped at Part 2. So if you did just come onto this page and you didn&#8217;t read Part 2 Go to the bottom of this post and click on Part 2.</p>
<p><strong>Ordering The MySQL Entrys:</strong></p>
<p><strong> </strong></p>
<p>In the previous part we added the MySQL Query to get the posts from one specific Table. But when we keep the codes like this we will get all posts out of the Table which includes pages and Draft posts. (The automaticly saved posts) So we need to Sort the posts. We will sort it so we only get the posts which are Published. We Do that with the following Code:</p>
<pre class="syntax-highlight:php">
WHERE post_type=&#039;post&#039;
</pre>
<p><strong>Sorting at Correct Order:</strong></p>
<p><strong> </strong></p>
<p>We also want the Posts to be Displayed as the Latest First. Not the first post at the top. So we order all posts in a Descending order. When you do Ascending you will have the first post on top and the last post at the bottom. You can also choose for &#8220;rand()&#8221; Which is Random. But that is not really good since you get all posts<br />
not in any post order. So it can be post:  2 than 6 than 3 than 1, etc.. We will do a Descending order by Post ID (For a correct order) by adding the following code right after the previous code:</p>
<pre class="syntax-highlight:php">
ORDER BY ID DESC
</pre>
<p> <strong>Limit the posts Per Page:<br />
 <br />
<span style="font-weight: normal;">When we have over 100 posts we don&#8217;t want all posts to be Displayed on the Latest Posts page</span> </strong>we create. So we will limit the count of entrys that will show. By adding a Limit code to the previous code. and adding the count of posts that should be displayed. We will do that by adding the following code(15 is the number of posts):</p>
<pre class="syntax-highlight:php">
LIMIT 15
</pre>
<p>Now the wpconf.php should look like this:</p>
<pre class="syntax-highlight:php">
&lt;?php

 // Make a MySQL Connection
mysql_connect(&quot;localhost&quot;, &quot;DatabaseUser&quot;, &quot;DatabasePass&quot;) or die(mysql_error());
mysql_select_db(&quot;DatabaseName&quot;) or die(mysql_error());

// Get all the data from the &quot;example&quot; table
$result = mysql_query(&quot;SELECT * FROM wp_posts WHERE post_type=&#039;post&#039; ORDER BY ID DESC LIMIT 15&quot;)
or die(mysql_error());

?&gt;
</pre>
<p>In the next part we will explain how we get all the info in the index.php test page.<br />
so please click on the right part below to go to part 4. </p>
<p><strong>The end of Part 3</strong></p>
<p><script type="text/javascript">
digg_url = 'http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/';
</script><br />
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<ul>
<li><a href="http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 1: How To Display Wordpress posts on your PHP site.</a> </li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-2-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 2: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-3-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 3: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-4-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 4: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-5-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 5: How To Display Wordpress posts on your PHP site.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.marceldoornbos.com/2008/10/part-3-how-to-display-wordpress-posts-on-your-php-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Part 2: How To Display Wordpress posts on your PHP site</title>
		<link>http://www.marceldoornbos.com/2008/10/part-2-how-to-display-wordpress-posts-on-your-php-site/</link>
		<comments>http://www.marceldoornbos.com/2008/10/part-2-how-to-display-wordpress-posts-on-your-php-site/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 11:33:13 +0000</pubDate>
		<dc:creator>Marcel Doornbos</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[School]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[Creation]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Display]]></category>

		<category><![CDATA[Frontpage]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[How]]></category>

		<category><![CDATA[How To]]></category>

		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Index]]></category>

		<category><![CDATA[Loop]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Outside]]></category>

		<category><![CDATA[Pagerank]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Self]]></category>

		<category><![CDATA[Site]]></category>

		<category><![CDATA[To]]></category>

		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://www.marceldoornbos.com/?p=8</guid>
		<description><![CDATA[

Welcome to Part 2: How To Display Wordpress posts on your PHP site
I will continue where i stoped at Part 1. So if you did just come onto this page and you didn&#8217;t read Part 1 Go to the bottom of this post and click on Part 1.
Creating a Test PHP page:
Now we know what [...]]]></description>
			<content:encoded><![CDATA[<div>
<div>
<p><strong>Welcome to Part 2: How To Display Wordpress posts on your PHP site</strong></p>
<p>I will continue where i stoped at Part 1. So if you did just come onto this page and you didn&#8217;t read Part 1 Go to the bottom of this post and click on Part 1.</p>
<p><strong>Creating a Test PHP page:</strong></p>
<p>Now we know what information we want to display on the php site, we will continue by coding it into the Page. (I use a Test php page to show you how it works.) </p>
<p>My working example is in the demo directory at:<br />
<strong>Demo php page:</strong> http://www.marceldoornbos.com/demo/site/index.php<br />
<strong>Demo Blog:</strong> http://www.marceldoornbos.com/demo/blog<br />
(For the blog i used Wordpress 2.6.2, The latest version at this moment)</p>
<p><strong>Creating the index.php file:</strong></p>
<p>Now we are going to create the testpage index.php file. If you are creating a Testpage also(Which i recommend) Follow my Steps. Otherwise you will allready have the main body, etc..</p>
<p>We start with the basic Index.php:<br />
 
<pre class="syntax-highlight:php">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Test Page Title&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p><strong>Adding MySQL Info:</strong></p>
<p>So now we have created the basic Index.php We will create another file called wpconf.php and add The MySQL Information to the wpconf.php file which is necessary to login to the MySQL Database. It uses the DB User, DB name, and Database Password. This info is the same as the Database info from your Wordpress blog. So now we will Add this to the wpconf.php:</p>
<pre class="syntax-highlight:php">
&lt;?php

// Make a MySQL Connection
mysql_connect(&quot;localhost&quot;, &quot;DatabaseUser&quot;, &quot;DatabasePassword&quot;) or die(mysql_error());
mysql_select_db(&quot;DatabaseName&quot;) or die(mysql_error()); 

?&gt;
 </pre>
<p>And wel will add the following line of code to the index.php between the <head> and </head> tags.:</p>
<pre class="syntax-highlight:php">
&lt;?php require(&quot;wpconf.php&quot;); ?&gt;
</pre>
<p>So now the index.php will look like:</p>
<pre class="syntax-highlight:php">
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Test Page Title&lt;/title&gt;
&lt;?php require(&quot;wpconf.php&quot;); ?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>This basicly Connects the wpconf.php to the database from the wordpress blog. and the wpconf.php sends the information to the index.php file. IF the mysql is incorrect it will Quit the connection and than the script won&#8217;t get any information from the Database, &#8220;or die(mysql_error()&#8221; checks if the information was correct and otherwise it would quite the connection. </p>
<p><strong>Getting Data Only from the wp_posts Table:</strong></p>
<p>Now we will add a Database Query to the wpconf.php file. We create a Variable for the query so we can easily call it from the actual php code. Let&#8217;s call that variable &#8220;$result&#8221;. Lets add the following Code to the document: </p>
<pre class="syntax-highlight:php">
// Get all the data from the &quot;wp_posts&quot; table
$result = mysql_query(&quot;SELECT * FROM wp_posts&quot;)
or die(mysql_error());
</pre>
<p>This code basicly sellects only the table wp_posts. We do that because we only need to information from that table because that is used at the frontpage of the blog. also again there is a &#8220;or die(mysql_error());&#8221; So if there is no table called &#8220;wp_posts&#8221; the mysql connection will be canceled and the script won&#8217;t get any information. </p>
<p>Now the wpconf.php should look like this:</p>
<pre class="syntax-highlight:php">
&lt;?php

// Make a MySQL Connection
mysql_connect(&quot;localhost&quot;, &quot;DatabaseUser&quot;, &quot;DatabasePassword&quot;) or die(mysql_error());
mysql_select_db(&quot;DatabaseName&quot;) or die(mysql_error()); 

// Get all the data from the &quot;wp_posts&quot; table
$result = mysql_query(&quot;SELECT * FROM wp_posts&quot;)
or die(mysql_error());
?&gt;
</pre>
<p>In the next part we will further get into the Order and Sorting of a MySQL database using the code above. so please click on the right part below to go to part 3. </p>
<p><strong>The end of Part 2</strong></p>
<p><script type="text/javascript">
digg_url = 'http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/';
</script><br />
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<ul>
<li><a href="http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 1: How To Display Wordpress posts on your PHP site.</a> </li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-2-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 2: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-3-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 3: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-4-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 4: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-5-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 5: How To Display Wordpress posts on your PHP site.</a></li>
</ul>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.marceldoornbos.com/2008/10/part-2-how-to-display-wordpress-posts-on-your-php-site/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Part 1: How To Display Wordpress posts on your PHP site.</title>
		<link>http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/</link>
		<comments>http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 09:41:33 +0000</pubDate>
		<dc:creator>Marcel Doornbos</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[School]]></category>

		<category><![CDATA[Tutorial]]></category>

		<category><![CDATA[Creation]]></category>

		<category><![CDATA[CSS]]></category>

		<category><![CDATA[Design]]></category>

		<category><![CDATA[Display]]></category>

		<category><![CDATA[Frontpage]]></category>

		<category><![CDATA[Google]]></category>

		<category><![CDATA[How]]></category>

		<category><![CDATA[How To]]></category>

		<category><![CDATA[HTML]]></category>

		<category><![CDATA[Index]]></category>

		<category><![CDATA[Loop]]></category>

		<category><![CDATA[MySQL]]></category>

		<category><![CDATA[Outside]]></category>

		<category><![CDATA[Pagerank]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Self]]></category>

		<category><![CDATA[Site]]></category>

		<category><![CDATA[To]]></category>

		<category><![CDATA[Wordpress]]></category>

		<category><![CDATA[WP]]></category>

		<guid isPermaLink="false">http://www.marceldoornbos.com/?p=3</guid>
		<description><![CDATA[Hi, 
Introduction:
A Few days ago i was searching the web on a tutorial on how to display wordpress posts Outside the wordpress directory. for example:     Wordpress is installed at: http://www.yourdomain.com/wordpress  and you want to display the wordpress posts in the members area at: http://www.yourdomain.com/members/index.php  in a news block or something. 
Since i didn&#8217;t find anything [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, </p>
<p><strong>Introduction:</strong></p>
<p>A Few days ago i was searching the web on a tutorial on how to display wordpress posts Outside the wordpress directory. for example:     Wordpress is installed at: http://www.yourdomain.com/wordpress  and you want to display the wordpress posts in the members area at: http://www.yourdomain.com/members/index.php  in a news block or something. </p>
<p>Since i didn&#8217;t find anything i thought about ways of doing this. The best thing that came up into my mind was using the MySQL database from wordpress itself. I&#8217;ve been paying with the code and i found out how to do that. And now i will explain everything to you so you can do the same when you are creating new websites.</p>
<p><strong>What do you need:</strong> </p>
<p>You will need:</p>
<p>- A Wordpress Blog (Where the posts must come from)<br />
- The Database information.<br />
- Another Website where you want to Display the posts.<br />
- a Good Text Editor.(Notepad++ is Recommended)<br />
- Knowledge of HTML and PHP and maybe some CSS.</p>
<p><strong>What info do you want:</strong></p>
<p>First of all you need to think about which info you will need from the posts. There are multiple fields of into in the Wordpress Database like: the title, the author, the link, the Post Date, the Post Date GMT, the modification date, the modification date GMT, the comment count, the content, the post type, Etc&#8230;</p>
<p>There is many info so i suggest you to write down the options you want.</p>
<p><strong>phpMyAdmin overview: </strong></p>
<p>Login to phpMyAdmin and go to your Wordpress Database. There you should see the following:</p>
<p><img class="alignnone" style="border: 0px;" src="http://www.marceldoornbos.com/wp-content/images/databasetablelist.png" alt="" width="642" height="206" /></p>
<p><strong>wp_posts Table overview:</strong></p>
<p>Out of the list above look for wp_posts and click on the first action button. Than you will see how it is build And what is inside the different rows. (It&#8217;s much easier to see which info is stored under which Row name when you use that action.) After you&#8217;ve clicked that you will see something similair to this: </p>
<p><img class="alignnone" style="border: 0px;" src="http://www.marceldoornbos.com/wp-content/images/wppostoverview.png" alt="" width="642" height="206" /></p>
<p>There you see See the above, with alot more rows with info in it. All those info represents the Wordpress Postmeta which is displayed on the frontpage of the Wordpress Blog. In that way you can fully recreate the index page of the wordpress blog. Or you can fully Integrate it into an excisting CMS. </p>
<p><strong>The end of Part 1</strong></p>
<p><script type="text/javascript">
digg_url = 'http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/';
</script><br />
<script src="http://digg.com/tools/diggthis.js" type="text/javascript"></script></p>
<ul>
<li><a href="http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 1: How To Display Wordpress posts on your PHP site.</a> </li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-2-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 2: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-3-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 3: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-4-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 4: How To Display Wordpress posts on your PHP site.</a></li>
<li><a href="http://www.marceldoornbos.com/2008/10/part-5-how-to-display-wordpress-posts-on-your-php-site/" target="_self">Part 5: How To Display Wordpress posts on your PHP site.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.marceldoornbos.com/2008/10/part-1-how-to-display-wordpress-posts-on-your-php-site/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
