<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WpFunc &#187; visitor</title>
	<atom:link href="http://wpfunc.com/tag/visitor/feed" rel="self" type="application/rss+xml" />
	<link>http://wpfunc.com</link>
	<description>Awesome, Quick, Simple WordPress Functions!</description>
	<lastBuildDate>Thu, 01 Dec 2011 01:17:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Create a Random Post Button!</title>
		<link>http://wpfunc.com/wordpress/create-a-random-post-button.html</link>
		<comments>http://wpfunc.com/wordpress/create-a-random-post-button.html#comments</comments>
		<pubDate>Wed, 05 May 2010 10:32:37 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[command]]></category>
		<category><![CDATA[posts]]></category>
		<category><![CDATA[post_status]]></category>
		<category><![CDATA[post_type]]></category>
		<category><![CDATA[random post]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[visitor]]></category>
		<category><![CDATA[wp_posts]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=428</guid>
		<description><![CDATA[You can create a ramdom post button for your visitors. If you create this the visitors can click it and can read any of your posts! Read this tutorial and simply apply this codes. Let&#8217;s Begin!
Here is the code;
1st step:  Get your post from SQL
We will use sql command for get random post. Here is [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">You can create a ramdom post button for your visitors. If you create this the visitors can click it and can read any of your posts! Read this tutorial and simply apply this codes. Let&#8217;s Begin!<span id="more-428"></span></p>
<h3>Here is the code;</h3>
<h3>1st step:  Get your post from SQL</h3>
<p>We will use sql command for get random post. Here is the command;</p>
<pre class="brush: sql; title: ; notranslate">SELECT guid FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY RAND() LIMIT 1</pre>
<p>Explaining of this command;</p>
<p><strong>guid:</strong> The URL of our post</p>
<p><strong>wp_posts:</strong> The table of posts</p>
<p><strong>post_type: </strong>This is the type of we get</p>
<p><strong>post_status: </strong> Is this published? Yes</p>
<p><strong>order by rand:</strong> Randomize of our request</p>
<p><strong>Limit:</strong> We limited for 1 post.</p>
<h3>2nd Step: Locate the php code where you want.</h3>
<pre class="brush: php; title: ; notranslate">&lt;?php
$randomPost = $wpdb-&gt;get_var(&quot;SELECT guid FROM $wpdb-&gt;posts WHERE post_type = 'post' AND post_status = 'publish' ORDER BY rand() LIMIT 1&quot;);
echo '&lt;a href=&quot;'.$randomPost.'&quot;&gt;Random Post&lt;/a&gt;';
?&gt;</pre>
<p>You can add this code where you want.<br />
That&#8217;s All. Have a nice day!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/create-a-random-post-button.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Say Hello to returning visitors!</title>
		<link>http://wpfunc.com/wordpress/say-hello-to-returning-visitors.html</link>
		<comments>http://wpfunc.com/wordpress/say-hello-to-returning-visitors.html#comments</comments>
		<pubDate>Sun, 27 Dec 2009 10:19:01 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[author]]></category>
		<category><![CDATA[comment]]></category>
		<category><![CDATA[comment_cookie]]></category>
		<category><![CDATA[function]]></category>
		<category><![CDATA[guest]]></category>
		<category><![CDATA[returning]]></category>
		<category><![CDATA[visitor]]></category>

		<guid isPermaLink="false">http://www.wpfunc.com/?p=334</guid>
		<description><![CDATA[We can use cookies for show some custom messages to our visitor. But this cookies are comment_cookie. Also show custom message to normal visitors. If you want to show this custom messages read this article. Let&#8217;s Begin&#8230;
Here is the code;
That&#8217;s All. Have a nice day!
]]></description>
			<content:encoded><![CDATA[<p style="text-align: justify;">We can use cookies for show some custom messages to our visitor. But this cookies are comment_cookie. Also show custom message to normal visitors. If you want to show this custom messages read this article. Let&#8217;s Begin&#8230;<span id="more-334"></span></p>
<h3>Here is the code;</h3>
<pre class="brush: php; title: ; notranslate">&lt;?php if(isset($_COOKIE['comment_author_'.COOKIEHASH])) {
	$lastCommenter = $_COOKIE['comment_author_'.COOKIEHASH];

	echo &quot;Welcome Back &quot;. $lastCommenter .&quot;!&quot;;

	} else {

	echo &quot;Welcome, Guest!&quot;;
} ?&gt;</pre>
<p>That&#8217;s All. Have a nice day!</p>
]]></content:encoded>
			<wfw:commentRss>http://wpfunc.com/wordpress/say-hello-to-returning-visitors.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

