<?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>glurt &#187; Wordpress</title>
	<atom:link href="http://glurt.com/category/wordpress/feed" rel="self" type="application/rss+xml" />
	<link>http://glurt.com</link>
	<description>webmaster tutorials and internet facts</description>
	<lastBuildDate>Mon, 01 Mar 2010 00:09:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.3</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Posting comments with PHP and curl automatically</title>
		<link>http://glurt.com/posting-comments-with-php-and-curl-automatically</link>
		<comments>http://glurt.com/posting-comments-with-php-and-curl-automatically#comments</comments>
		<pubDate>Wed, 16 Dec 2009 23:33:13 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[curl]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=292</guid>
		<description><![CDATA[
Here is an experiment of posting comments with php curl library, this is the part of glurt seo tools. With a little imagination you may create a great auto commenting software for any blog cms and any website to promote your website on web or for another purposes. I created this script because I was [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-293" style="margin-left: 10px; margin-right: 10px;" title="curl" src="http://glurt.com/wp-content/uploads/2009/12/curl-300x288.jpg" alt="curl" width="300" height="288" /></p>
<p>Here is an experiment of posting comments with php curl library, this is the part of glurt seo tools. With a little imagination you may create a great auto commenting software for any blog cms and any website to promote your website on web or for another purposes. I created this script because I was lazy to enter the name, email address again and again. I&#8217;ve come with the curl and PHP solution to post comments on wordpress blogs that I am interested in by typing url only inside of form field on my localhost, clicking submit , and the comment is there, sent by curl with PHP.</p>
<ol>
<li><strong>POST DATA we will need</strong></li>
</ol>
<p>First, before creating the script I figured out which POST variables are being transferred by wordpress comment form, form action (where the comment submission process done).  I opened the wordpress post&#8217;s html source (in mozilla firefox right mouse click-&gt;view source code) I found something similar to :</p>
<p><strong>&lt;form action=&#8221;http://blog.php/wp-comments-post.php&#8221; method=&#8221;post&#8221; id=&#8221;commentform&#8221;&gt;<br />
&lt;p&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;author&#8221; id=&#8221;author&#8221; value=&#8221;" size=&#8221;22&#8243; tabindex=&#8221;1&#8243; /&gt;<br />
&lt;label for=&#8221;author&#8221;&gt;&lt;small&gt;Name<br />
(required)    &lt;/small&gt;&lt;/label&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;email&#8221; id=&#8221;email&#8221; value=&#8221;" size=&#8221;22&#8243; tabindex=&#8221;2&#8243; /&gt;<br />
&lt;label for=&#8221;email&#8221;&gt;&lt;small&gt;Mail (will not be published)<br />
(required)    &lt;/small&gt;&lt;/label&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;url&#8221; id=&#8221;url&#8221; value=&#8221;" size=&#8221;22&#8243; tabindex=&#8221;3&#8243; /&gt;<br />
&lt;label for=&#8221;url&#8221;&gt;&lt;small&gt;Website&lt;/small&gt;&lt;/label&gt;<br />
&lt;/p&gt;<br />
&lt;!&#8211;&lt;p&gt;&lt;small&gt;&lt;strong&gt;XHTML:&lt;/strong&gt; You can use these tags: &amp;lt;a href=&amp;quot;&amp;quot; title=&amp;quot;&amp;quot;&amp;gt; &amp;lt;abbr title=&amp;quot;&amp;quot;&amp;gt; &amp;lt;acronym title=&amp;quot;&amp;quot;&amp;gt; &amp;lt;b&amp;gt; &amp;lt;blockquote cite=&amp;quot;&amp;quot;&amp;gt; &amp;lt;cite&amp;gt; &amp;lt;code&amp;gt; &amp;lt;del datetime=&amp;quot;&amp;quot;&amp;gt; &amp;lt;em&amp;gt; &amp;lt;i&amp;gt; &amp;lt;q cite=&amp;quot;&amp;quot;&amp;gt; &amp;lt;strike&amp;gt; &amp;lt;strong&amp;gt; &lt;/small&gt;&lt;/p&gt;&#8211;&gt;<br />
&lt;p&gt;<br />
&lt;textarea name=&#8221;comment&#8221; id=&#8221;comment&#8221; cols=&#8221;100%&#8221; rows=&#8221;10&#8243; tabindex=&#8221;4&#8243;&gt;&lt;/textarea&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;input name=&#8221;submit&#8221; type=&#8221;submit&#8221; id=&#8221;submit&#8221; tabindex=&#8221;5&#8243; value=&#8221;Submit Comment&#8221; /&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;comment_post_ID&#8221; value=&#8221;287&#8243; /&gt;<br />
&lt;/p&gt;<br />
&lt;/form&gt;</strong></p>
<p>The variables we will use for cron execution from form above are :</p>
<p><strong>Form action url: </strong><strong>http://blog.php/wp-comments-post.php  &#8211; wordpress uses &#8220;wp-comments-post.php&#8221; file as a file for comment storing into the database. </strong></p>
<p><strong>Author :  is the name of comment author, most of the wordpress blogs require it .</strong></p>
<p><strong>Email : Is a commenter email</strong></p>
<p><strong>Url : Is a url of your website</strong></p>
<p><strong>Submit : this variable is necessary for submitting the result in </strong><strong>&#8220;wp-comments-post.php&#8221;.</strong></p>
<p><strong>comment_post_ID: is a hidden value, necessary for wp database that tells the script which post to bind comment to.<br />
</strong></p>
<p>Author and email are required fields for cron operation, post id is also necessary because we should know where to post the comment.  comment_post_ID is also neccessary to tell the script in which post comment will appear.</p>
<p><strong>2. Getting wordpress post id comment_post_ID from wordpress post</strong></p>
<p>To get post id to use it for curl form submission we will need comment_post_ID from post form . We will crawl the html with curl and take comment_post_ID variable in numeric format using regular expressions:</p>
<p><strong>&lt;?php<br />
</strong></p>
<p><strong><code>// CURL function to get the page and to insert it inside php variable.<br />
function get_web_page( $url )<br />
{<br />
$options = array(<br />
CURLOPT_RETURNTRANSFER =&gt; true,     // return web page<br />
CURLOPT_HEADER         =&gt; false,    // don't return headers<br />
CURLOPT_FOLLOWLOCATION =&gt; true,     // follow redirects<br />
CURLOPT_ENCODING       =&gt; "",       // handle all encodings<br />
CURLOPT_USERAGENT      =&gt; "spider", // who am i<br />
CURLOPT_AUTOREFERER    =&gt; true,     // set referer on redirect<br />
CURLOPT_CONNECTTIMEOUT =&gt; 120,      // timeout on connect<br />
CURLOPT_TIMEOUT        =&gt; 120,      // timeout on response<br />
CURLOPT_MAXREDIRS      =&gt; 10,       // stop after 10 redirects<br />
);</code></strong></p>
<p><strong> $ch      = curl_init( $url );<br />
curl_setopt_array( $ch, $options );<br />
$content = curl_exec( $ch );<br />
$err     = curl_errno( $ch );<br />
$errmsg  = curl_error( $ch );<br />
$header  = curl_getinfo( $ch );<br />
curl_close( $ch );</strong></p>
<p><strong> $header['errno']   = $err;<br />
$header['errmsg']  = $errmsg;<br />
$header['content'] = $content;<br />
return $header;<br />
}</strong></p>
<p><strong>function executeComment($name,$email,$url,$comment,$baseUrl,$postId)</strong></p>
<p><strong>{<br />
$curlPost = &#8216;author=&#8217;.$name.&#8217;&amp;email=&#8217;.$email.&#8217;&amp;url=&#8217;.$url.&#8217;&amp;comment=&#8217; . urlencode($comment) . &#8216;&amp;submit=Submit+Comment&amp;comment_post_ID=&#8217;.<strong>$postId</strong></strong><strong>;<br />
$ch = curl_init();<br />
curl_setopt($ch, CURLOPT_URL, &#8216;http://&#8217;.<strong>$baseUrl</strong></strong><strong>.&#8217;/wp-comments-post.php&#8217;);<br />
curl_setopt($ch, CURLOPT_HEADER, 1);<br />
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);<br />
curl_setopt($ch, CURLOPT_POST, 1);<br />
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);<br />
$data = curl_exec($ch);<br />
curl_close($ch);</strong></p>
<p><strong>}<br />
</strong></p>
<p><strong>function getDomain($url)</strong></p>
<p><strong>{</strong></p>
<p><strong> </strong><strong>$pt = explode(&#8221;/&#8221;,$url);<br />
$burl = $pt[2];<br />
$result = get_web_page( $url );</strong></p>
<p><strong> return $result;<br />
</strong></p>
<p><strong>}<br />
</strong></p>
<p><strong>// this is an url to post comment on &#8230;<br />
$url = &#8216;http://www.branded07.com/2009/07/11/ie6-web-design-tricks/&#8217;;</strong></p>
<p><strong>// we need </strong><strong>www.branded07.com domain name for future usage ,  we will use our getDomain() function</strong></p>
<p><strong>$domain = getDomain($url);</strong></p>
<p><strong><br />
</strong></p>
<p><strong>// now we need to crawl the page and to get post ID</strong></p>
<p><strong>// we crawling the post url<br />
</strong></p>
<p><strong>$result = get_web_page( </strong><strong>$url  );</strong></p>
<p><strong>// page content is in the $page variable<br />
$page = $result['content'];</strong></p>
<p><strong><br />
</strong></p>
<p><strong>// getting the post ID with regular expressions</strong></p>
<p><strong>$matches = array();<br />
preg_match( &#8216;!&lt;input.*?name=&#8221;comment_post_ID&#8221;.*?value=&#8221;(.*?)&#8221;!&#8217;, $page, $matches );<br />
// this is a comment id to post comment<br />
$pid = $matches[1];</strong></p>
<p><strong><br />
</strong></p>
<p><strong>// execute comment posting with curl</strong></p>
<p><strong>$name = &#8220;glurt&#8221;;</strong></p>
<p><strong>$email = &#8220;admin@glurt.com&#8221;;</strong></p>
<p><strong>$url = &#8220;http://glurt.com&#8221;;</strong></p>
<p><strong>$comment = &#8220;This is the test comment&#8221;;</strong></p>
<p><strong>$baseUrl = $domain;</strong></p>
<p><strong>$postId = $pid;<br />
</strong></p>
<p><strong><strong>executeComment($name,$email,$url,$comment,$baseUrl,$postId)</strong>;</strong></p>
<p><strong><br />
</strong></p>
<p><strong>?&gt;</strong></p>
<p><strong>Conclusion : </strong><br />
We figured out what variables uses wordpress blog to post comments, we used this data to create comments posting script that needs only one url of wordpress web blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/posting-comments-with-php-and-curl-automatically/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress twitter search box designs</title>
		<link>http://glurt.com/wordpress-twitter-search-box-designs</link>
		<comments>http://glurt.com/wordpress-twitter-search-box-designs#comments</comments>
		<pubDate>Thu, 13 Aug 2009 13:03:16 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[twitter APPs]]></category>
		<category><![CDATA[wordpress twitter tools]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=240</guid>
		<description><![CDATA[In this post you will learn how to change designs for wordpress twitter search provided by twitterloo twitter search engine. All the forms are made on html language, and we will teach you how to change basic form colors to fit your wordpress blog design. This tutorial for bloggers and anyone wants to know how [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-245" style="margin: 5px 10px;" title="OneSearchGlass" src="http://glurt.com/wp-content/uploads/2009/08/OneSearchGlass-300x300.jpg" alt="OneSearchGlass" width="142" height="119" />In this post you will learn how to change designs for wordpress twitter search provided by <a href="http://twitterloo.info" target="_blank">twitterloo twitter search</a> engine. All the forms are made on html language, and we will teach you how to change basic form colors to fit your wordpress blog design. This tutorial for bloggers and anyone wants to know how to integrate twitter search html into website or blog.</p>
<p>We will start from standard form provided by <a href="http://twitterloo.info" target="_blank">twitterloo</a>, then we will change some fonts, images and more to our twitter search form element :</p>
<div style="border: 1px solid #cccccc; background: #f6f6f6 none repeat scroll 0% 0%; width: 100%; margin-bottom: 0.5em;">
<form style="padding:1em;" action="http://www.twitterloo.info" method="get">
<input id="search" style="width: 150px;" onclick="this.value='';" maxlength="150" name="category" type="text" value="Search twitter" />
<input type="submit" value="search" /> </form>
</div>
<p>The standard code for this form is :</p>
<p><strong>&lt;div style=&#8221;width:100%;background:#f6f6f6;border:1px solid #ccc;margin-bottom:.5em;&#8221;&gt;<br />
&lt;form style=&#8221;padding:1em;&#8221; action=&#8221;http://www.twitterloo.info&#8221; method=&#8221;get&#8221;&gt;<br />
&lt;input style=&#8221;width:150px;&#8221; type=&#8221;text&#8221; name=&#8221;category&#8221; id=&#8221;search&#8221; maxlength=&#8221;150&#8243; value=&#8221;Search twitter&#8221; onclick=&#8221;this.value=&#8221;;&#8221;  &gt;<br />
&lt;input type=&#8221;submit&#8221; value=&#8221;search&#8221; /&gt;<br />
&lt;/form&gt;<br />
&lt;/div&gt;</strong></p>
<p>Now lets change some text field and background design, we will use yellow color, but you can use any color you want, we will show exactly where the color should be changed. The width of search input field changed, now it&#8217;s wider.</p>
<div style="border: 1px solid #cccccc; background: yellow none repeat scroll 0% 0%; width: 100%; margin-bottom: 0.5em;">
<form style="padding:1em;" action="http://www.twitterloo.info" method="get">
<input id="search" style="width: 88%;" onclick="this.value='';" maxlength="150" name="category" type="text" value="Search twitter" />
<input type="submit" value="search" /> </form>
</div>
<p>The code for search box below is :</p>
<p>We marked in bold place to change background color and width of the search field, you can use defined colors like yellow,green,black, etc or define hexadecimal value of color, #cccccc will be light gray for example.</p>
<p>&lt;div style=&#8221;border: 1px solid #cccccc; <strong>background: yellow</strong> none repeat scroll 0% 0%; <strong>width: 100%</strong>; margin-bottom: 0.5em;&#8221;&gt;&lt;form style=&#8221;padding:1em;&#8221; action=&#8221;http://www.twitterloo.info&#8221; method=&#8221;get&#8221;&gt; &lt;input id=&#8221;search&#8221; style=&#8221;<strong>width: 88%;</strong>&#8221; onclick=&#8221;this.value=&#8221;;&#8221; maxlength=&#8221;150&#8243; name=&#8221;category&#8221; type=&#8221;text&#8221; value=&#8221;Search twitter&#8221; /&gt; &lt;input type=&#8221;submit&#8221; value=&#8221;search&#8221; /&gt; &lt;/form&gt;&lt;/div&gt;</p>
<p>Use your imagination, you may use any color, you can define fonts and images for this html object. Another great choice is to create simple html page and to paste the code there, get your free search engine, and add great feature to your website.</p>
<p>Good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/wordpress-twitter-search-box-designs/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add twitter search engine into wordpress blog</title>
		<link>http://glurt.com/how-to-add-twitter-search-engine-into-wordpress-blog</link>
		<comments>http://glurt.com/how-to-add-twitter-search-engine-into-wordpress-blog#comments</comments>
		<pubDate>Sun, 26 Jul 2009 17:03:29 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[twitter APPs]]></category>
		<category><![CDATA[twitter search plugin]]></category>
		<category><![CDATA[wordpress plugin]]></category>
		<category><![CDATA[wordpress twitter search]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=186</guid>
		<description><![CDATA[To add twitter search engine into your wordpress you don&#8217;t need any plugins.  Twitterloo green bear search engine allows you to embed the html code into your wordpress blog. Let your visitors search latest tweets and youtube videos.
How to embed twitter search into your wordpress blog ? Simple login to your wp-admin, click on appearance [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="http://twitterloo.info/images/twitterloo.jpg" alt="" width="300" height="288" />To add twitter search engine into your wordpress you don&#8217;t need any plugins.  Twitterloo green bear search engine allows you to embed the html code into your wordpress blog. Let your visitors search latest tweets and youtube videos.</p>
<p>How to embed twitter search into your wordpress blog ? Simple login to your wp-admin, click on appearance on the left admin menu, editor. Choose sidebar (sidebar.php) enter code below after &lt;div id=&#8221;sidebar&#8221;&gt; : or go to <strong><a href="http://Twitterloo.info" target="_blank">twitterloo.info</a></strong> and copy html code from there.</p>
<p>&lt;div style=&#8221;width:100%;background:#f6f6f6;border:1px solid #ccc;margin-bottom:.5em;&#8221;&gt;<br />
&lt;form style=&#8221;padding:1em;&#8221; action=&#8221;http://www.twitterloo.info&#8221; method=&#8221;get&#8221;&gt;<br />
&lt;input style=&#8221;width:150px;&#8221; type=&#8221;text&#8221; name=&#8221;category&#8221; id=&#8221;search&#8221; maxlength=&#8221;150&#8243; value=&#8221;Search twitter&#8221; onclick=&#8221;this.value=&#8221;;&#8221;  &gt;<br />
&lt;input type=&#8221;submit&#8221; value=&#8221;search&#8221; /&gt;<br />
&lt;/form&gt;<br />
&lt;/div&gt;</p>
<p>You can see example on our sidebar, search twitter form.</p>
<p>You can modify code above to fit your website design.</p>
<p>That&#8217;s it , good luck.</p>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/how-to-add-twitter-search-engine-into-wordpress-blog/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>7 cool wordpress themes</title>
		<link>http://glurt.com/7-cool-wordpress-themes</link>
		<comments>http://glurt.com/7-cool-wordpress-themes#comments</comments>
		<pubDate>Mon, 20 Jul 2009 04:47:40 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=139</guid>
		<description><![CDATA[Every day created thousands of wordpress templates. There are big internet market in wordpress templates, there are simple ones, 2,3 columns, flash,no flash wordpress templates. Which template will be best for your blog, should you choose the free theme or paid one.  What is the price range for wordpress templates, and what is the difference [...]]]></description>
			<content:encoded><![CDATA[<p>Every day created thousands of wordpress templates. There are big internet market in wordpress templates, there are simple ones, 2,3 columns, flash,no flash wordpress templates. Which template will be best for your blog, should you choose the free theme or paid one.  What is the price range for wordpress templates, and what is the difference between free ones and paid ones. We collected most beautiful wordpress templates for your consideration. Every link is pointed to template download page.</p>
<h1><a href="http://wordpress.org/extend/themes/fusion" target="_blank">Fusion template</a></h1>
<p><a href="http://wordpress.org/extend/themes/fusion"><img class="size-full wp-image-140 alignnone" title="fusion" src="http://glurt.com/wp-content/uploads/2009/07/fusion.png" alt="fusion" width="300" height="225" /></a></p>
<h1><a href="http://www.jauhari.net/themes/hamasaki" target="_blank">Hamasaki theme</a></h1>
<h1><a href="http://www.jauhari.net/themes/hamasaki" target="_blank"><img class="alignnone size-full wp-image-141" title="hamasaki-theme" src="http://glurt.com/wp-content/uploads/2009/07/hamasaki-theme.jpg" alt="hamasaki-theme" width="500" height="721" /></a></h1>
<h1><a href="http://wordpress.org/extend/themes/atahualpa" target="_blank">Atahualpa theme</a></h1>
<h1><a href="http://wordpress.org/extend/themes/atahualpa" target="_blank"><img class="alignnone size-full wp-image-142" title="screenshot" src="http://glurt.com/wp-content/uploads/2009/07/screenshot.png" alt="screenshot" width="300" height="220" /></a></h1>
<h1><a href="http://wordpress.org/extend/themes/arras-theme" target="_blank">Arras theme</a></h1>
<h1><a href="http://wordpress.org/extend/themes/arras-theme" target="_blank"><img class="alignnone size-full wp-image-143" title="arras-theme" src="http://glurt.com/wp-content/uploads/2009/07/arras-theme.png" alt="arras-theme" width="300" height="225" /></a></h1>
<h1><a href="http://wordpress.org/extend/themes/carrington-blog" target="_blank"><br />
</a></h1>
<h1><a href="http://wordpress.org/extend/themes/carrington-blog" target="_blank">Carrington Blog</a></h1>
<h1><a href="http://wordpress.org/extend/themes/carrington-blog" target="_blank"><img class="alignnone size-full wp-image-144" title="carrington-theme" src="http://glurt.com/wp-content/uploads/2009/07/carrington-theme.png" alt="carrington-theme" width="240" height="180" /></a></h1>
<h1></h1>
<h1><a href="http://themes.rock-kitty.net/tech-dream/" target="_blank">Tech Dream</a></h1>
<p><a href="http://www.skinpress.com/treehouse/" target="_blank"><br />
</a></p>
<h1><a href="http://www.skinpress.com/treehouse/" target="_blank">Creative Blog</a></h1>
<h1><a href="http://www.skinpress.com/treehouse/" target="_blank"><img class="alignnone size-full wp-image-146" title="theme" src="http://glurt.com/wp-content/uploads/2009/07/theme.jpg" alt="theme" width="398" height="556" /></a></h1>
<h1></h1>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/7-cool-wordpress-themes/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Wordpress changing domain name and moving hosting</title>
		<link>http://glurt.com/wordpress-changing-domain-name-and-moving-hosting</link>
		<comments>http://glurt.com/wordpress-changing-domain-name-and-moving-hosting#comments</comments>
		<pubDate>Sun, 19 Jul 2009 13:35:54 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=127</guid>
		<description><![CDATA[Sometimes it is necessary to move wordpress blog to another hosting or to change domain name to another one.  In this tutorial we are using linux based hosting.
Step 1.
First step in moving wordpress blog to another hosting ( in our example it will be with another domain name ) you should backup your wordpress blog [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes it is necessary to move wordpress blog to another hosting or to change domain name to another one.  In this tutorial we are using linux based hosting.</p>
<p><em><strong>Step 1.</strong></em></p>
<p>First step in moving wordpress blog to another hosting ( in our example it will be with another domain name ) you should backup your wordpress blog database.  It is made simple with <strong>phpmyadmin</strong> , login your hosting cpanel and open phpmyadmin, click on your database name on the left menu, then click export on the top menu.</p>
<p style="text-align: center;"><img class="size-full wp-image-129 aligncenter" title="wordpress1" src="http://glurt.com/wp-content/uploads/2009/07/wordpress1.png" alt="wordpress1" width="600" height="225" /></p>
<p>Now select .sql format and click continue, you can also check zipped format and your file will be downloaded in .tar.gz or .zip format.</p>
<p>What did we do actually ? We exported our database from mysql into .sql file format that contains all mysql data, and now we can use this file to import it to another hosting database.</p>
<p>Keep this .sql database file for future maintenance.</p>
<p>Now go to your server root, open editor with &#8220;hidden files option&#8221;, don&#8217;t forget .htaccess file that usually is hidden, and compress all the wordpress files into zip archive and download it to your computer.</p>
<p>Now we have exported database .sql file or archive file with .sql file in it and zipped file of all wordpress files.</p>
<p>When we&#8217;ve done backup of everything on our old domain and server, we can leave it alone ( don&#8217;t delete anything there before you installed all the files on your new host)</p>
<p><em><strong>Step 2.</strong></em></p>
<p>Ftp zipped wordpress files to your new hosting root and unpack everything in root directory, make sure you didn&#8217;t forget .htaccess file on old hosting.</p>
<p>Now create database using mysql databases or mysql databases wizard, specify database name,  username and password.</p>
<p>Now import database, go to phpmyadmin, click on import on the top menu and import backuped .sql file. If there are any errors, drop all the tables and open .sql file with your editor,  you will see database query commands, every command ends with ; symbol. Copy and paste every command into sql editor and execute. Picture below shows how to find sql editor inside phpmyadmin :</p>
<p style="text-align: center;"><img class="size-full wp-image-130 aligncenter" title="wordpress2" src="http://glurt.com/wp-content/uploads/2009/07/wordpress2.png" alt="wordpress2" width="222" height="244" /></p>
<p>Edit file called <strong>wp-config.php</strong> located in your server root with any editor and follow instructions mentioned by wordpress codex : <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank">here </a></p>
<p><em><strong>Step 3. </strong></em></p>
<p>Change your domain name registrar nameservers to point to your new hosting.</p>
<p>If you use the same domain name as before, you can skip steps below, your wordpress blog will work fine, navigate browser to your domain name and your blog installed.</p>
<p>If you use different domain name, go back to phpmyadmin or your mysql database browser, open .sql editor , we will need to update a few lines in our database, you can edit it manually by editing tables inside phpmyadmin, or you can insert next commands into sql editor to make it faster :</p>
<p><strong><code>UPDATE wp_options SET option_value = replace(option_value, 'http://www.old-domain.com', 'http://www.new-domain.com') WHERE option_name = 'home' OR option_name = 'siteurl';</code></strong></p>
<p>Command above updates &#8220;wp_options&#8221; table inside wordpress database.</p>
<p>Next we will update wordpress blog&#8217;s post and pages with following command :</p>
<p><strong><code>UPDATE wp_posts SET guid = replace(guid, 'http://www.old-domain.com','http://www.new-domain.com');</code></strong></p>
<p>And to update internal linking :</p>
<p><strong><code>UPDATE wp_posts SET post_content = replace(post_content, 'http://www.old-domain.com', 'http://www.new-domain.com');</code></strong></p>
<p><em><strong>Step 4. </strong></em></p>
<p>Check if everything is ok . If you forgot or don&#8217;t have your wordpress admin password, you will need once again update your mysql.</p>
<p>First generate your md5 hash code , go to <a href="http://www.zappersoftware.com/Help/md5.php" target="_blank">this</a> page, enter your password, and submit. Copy generated md5 hash.</p>
<p>Login to your phpmyadmin and click on sql editor, enter lines below to update your database:</p>
<pre><strong><span style="color: #000000;"><span style="font-weight: bold;">UPDATE</span> wp_users <span style="font-weight: bold;">SET</span> user_pass="HERE_IS_GENERATED_MD5_HASH_CODE"
<span style="font-weight: bold;">WHERE</span> ID = </span><span style="color: #cc66cc;"><span style="color: #000000;">1</span>

<span style="color: #000000;">That's it ! If you have any questions, post comments. 

Good luck
</span></span></strong></pre>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/wordpress-changing-domain-name-and-moving-hosting/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress sidebar tutorial</title>
		<link>http://glurt.com/wordpress-sidebar-tutorial</link>
		<comments>http://glurt.com/wordpress-sidebar-tutorial#comments</comments>
		<pubDate>Mon, 06 Jul 2009 12:45:07 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress design]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[wordpress API]]></category>
		<category><![CDATA[wordpress sidebar]]></category>
		<category><![CDATA[Wordpress sidebar tutorial]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=46</guid>
		<description><![CDATA[Did you know ? You can add anything on your wordpres blog sidebar, we will teach you how to use wordpress API to modify sidebar without any plugin. Just with PHP wordpress API definitions.
Let&#8217;s start. Go to your wp-admin , click on appearance, click editor, you will see your theme files on sidebar. Find file [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-47" title="icon_big" src="http://glurt.com/wp-content/uploads/2009/07/icon_big1-300x267.png" alt="icon_big" width="300" height="267" />Did you know ? You can add anything on your wordpres blog sidebar, we will teach you how to use wordpress API to modify sidebar without any plugin. Just with PHP wordpress API definitions.</p>
<p>Let&#8217;s start. Go to your wp-admin , click on appearance, click editor, you will see your theme files on sidebar. Find file called <strong>functions.php</strong> did you find this file ? Good. If you didn&#8217;t find functions.php file, created it in your wordpress template directory or upload it with ssh or ftp to your theme directory.</p>
<p>Edit file <strong>functions.php</strong> you should find code below if exists or add it manually if it doesn&#8217;t exists :</p>
<p>&lt;?php<br />
automatic_feed_links();<br />
if ( function_exists(’register_sidebar’) ) {<br />
register_sidebar(array(<br />
‘before_widget’ =&gt; ‘&lt;li id=”%1$s”&gt;’,<br />
‘after_widget’ =&gt; ‘&lt;/li&gt;’,<br />
‘before_title’ =&gt; ‘&lt;h2&gt;’,<br />
‘after_title’ =&gt; ‘&lt;/h2&gt;’,<br />
));<br />
}<br />
?&gt;</p>
<p>What the code does actually ? This code activates widgets of your wordpress blog, if this code exists in your functions.php file , you can check if widgets activated on your sidebar, you can code conditional sidebar, if widgets activated (it checks existance of widgets initiation in functions.php) it will show the widgets, if not activated, it will show something else. Here is the example of what could happened whith our code :</p>
<blockquote><p>&lt;div id=”sidebar”&gt;<br />
&lt;?php<br />
if ( !function_exists(’dynamic_sidebar’) || !dynamic_sidebar() ) : ?&gt;<br />
&lt;h2&gt;&lt;?php _e(’Categories’); ?&gt;&lt;/h2&gt;</p>
<p>&lt;ul&gt;</p>
<p>&lt;?php wp_list_cats(’sort_column=name&amp;optioncount=1&amp;hierarchical=0?); ?&gt;</p>
<p>&lt;/ul&gt;</p>
<p>&lt;h2&gt;&lt;?php _e(’Archives’); ?&gt;&lt;/h2&gt;</p>
<p>&lt;ul&gt;</p>
<p>&lt;?php wp_get_archives(’type=monthly’); ?&gt;</p>
<p>&lt;/ul&gt;<br />
&lt;?<br />
endif;<br />
?&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>Do you recognize conditional call ? <strong>&lt;?php if ( !function_exists(’dynamic_sidebar’) || !dynamic_sidebar() ) : ?&gt; </strong>It checks whether dynamic_sidebar exists.</p>
<p>Well, I think you have a better imagination than me to create your sidebar with additional functionality if widgets are not activated. But I will go further and will show you how to add posts from different categories and quantity on your sidebar, it will widespread your limits of imagination.</p>
<p>The idea to put inside of sidebar shorten post element, with additional PHP knowledge, you can fetch any object like image or video from your post and to show it on your sidebar or any part of html object of your wordpress blog.</p>
<p>We commented every single line of code for better understanding what just happened with your sidebar.  In our example we will use videos, before adding the code we created category called &#8220;video&#8221; and inserted one post with youtube video.  Now we should know our category id, click on posts, categories on the left wp-admin menu, you will see all blog&#8217;s categories, click on video category and take a look at your browser address bar, there is $_GET variable called cat_ID, we need the value of this variable , in tutorial below we user value 3, I suppose in your blog the value is different .</p>
<blockquote>
<pre><strong><cite>// checks if there are some wordpress posts.
&lt;?php</cite> <span style="text-decoration: underline;">if</span> ( have_posts() ) : <cite>?&gt;</cite></strong>

// Take a look on the line below <strong><strong>showposts=1</strong></strong> the quantity of posts to show.
// &amp;cat=3 , change 3 to your category id 

<strong><cite>&lt;?php</cite> <a>$my_query</a> = <span style="text-decoration: underline;">new</span> WP_Query('showposts=1&amp;cat=3');

<span style="text-decoration: underline;">while</span> (<a>$my_query</a>-&gt;have_posts()) : <a>$my_query</a>-&gt;the_post();
  <a>$do_not_duplicate</a> = <a>$post</a>-&gt;ID;<cite>?&gt;</cite></strong>

<strong><cite>&lt;?php

// video file from database using </cite></strong><strong><strong>preg_match_all</strong></strong> and mysql functions
<strong><cite>
</cite><a>$id</a> =<a>$post</a>-&gt;ID;
<a>$the_content</a> =<a>
$wpdb</a>-&gt;get_var("SELECT post_content FROM <a>$wpdb</a>-&gt;posts WHERE ID = <a>$id</a> ");
<a>$pattern</a> = '!&lt;embed.*?src="(.*?)"!';

preg_match_all(<a>$pattern</a>, <a>$the_content</a>, <a>$matches</a>);
<a>$obj_src</a> = <a>$matches</a>['1'][0];
<cite>?&gt;</cite></strong>

<strong><cite>&lt;?php</cite> <span style="text-decoration: underline;">if</span>(<a>$obj_src</a> != '') 

{ 

// video output

<span style="text-decoration: underline;">echo</span> '<strong>&lt;b&gt;</strong>Latest Video<strong>&lt;/b&gt;</strong><strong>&lt;br&gt;</strong><strong>&lt;br&gt;</strong><strong>&lt;object width="160" height="120"&gt;
</strong><strong>&lt;param name="movie" value="'.<a>$obj_src.</a>'"&gt;</strong><strong>&lt;/param&gt;
</strong><strong>&lt;param name="allowFullScreen" value="<span style="text-decoration: underline;">true</span>"&gt;</strong><strong>&lt;/param&gt;
</strong><strong>&lt;param name="allowscriptaccess" value="always"&gt;</strong><strong>&lt;/param&gt;
</strong><strong>&lt;embed src="'.<a>$obj_src.</a>'" type="application/x-shockwave-flash"
allowscriptaccess="always" allowfullscreen="<span style="text-decoration: underline;">true</span>" width="160" height="120"&gt;</strong><strong>&lt;/embed&gt;
</strong><strong>&lt;/object&gt;</strong><strong>&lt;br&gt;</strong><strong>&lt;br&gt;</strong>'; 

}

<cite>?&gt;</cite></strong>
 <strong><cite>&lt;?php</cite> <span style="text-decoration: underline;">endwhile</span>; <cite>?&gt;</cite></strong>

<strong><cite>&lt;?php</cite> <span style="text-decoration: underline;">endif</span>; <cite>?&gt;</cite></strong></pre>
</blockquote>
<p>It was a simple tutorial how to hack your wordpress sidebar, by the way , this code works well on other wordpress elements like header, footer and so on &#8230; Use your imagination in your blog creation.</p>
<p>Good luck.<strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/wordpress-sidebar-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress Sidebar RSS feed tutorial</title>
		<link>http://glurt.com/wordpress-sidebar-rss-feed-tutorial</link>
		<comments>http://glurt.com/wordpress-sidebar-rss-feed-tutorial#comments</comments>
		<pubDate>Sun, 05 Jul 2009 12:05:57 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[rss tutorial]]></category>
		<category><![CDATA[wordpress rss tutorial]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=36</guid>
		<description><![CDATA[Sometimes we want to add some RSS feed into our blog or website from somewhere, the good idea is to add RSS from our another blog to share traffic between blogs, maybe you have some forum and you want to add blog&#8217;s RSS feed into it.
The best solution is PHP XML functions to do it [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-37" title="rss_logo" src="http://glurt.com/wp-content/uploads/2009/07/rss_logo-300x298.jpg" alt="rss_logo" width="300" height="298" />Sometimes we want to add some RSS feed into our blog or website from somewhere, the good idea is to add RSS from our another blog to share traffic between blogs, maybe you have some forum and you want to add blog&#8217;s RSS feed into it.</p>
<p>The best solution is PHP XML functions to do it on any blog or CMS PHP written platphorm.</p>
<p>To add RSS feed from somewhere open your wordpress sidebar.php, read through code comments to understand where should you put the RSS reading code and output code :</p>
<p>Enter this code before &lt;div id=&#8221;sidebar&#8221;&gt; html code. Take a look at the code. To change RSS feed url , you need to edit only one variable.  <strong>$uFile = &#8220;http://glurt.com/feed&#8221;; </strong>Find these line below and change the url to your RSS feed url.<strong><br />
</strong></p>
<blockquote><p>&lt;?</p>
<p>class xItem {<br />
var $xTitle;<br />
var $xLink;<br />
var $xDescription;<br />
}</p>
<p>// general vars<br />
$sTitle = &#8220;&#8221;;<br />
$sLink = &#8220;&#8221;;<br />
$sDescription = &#8220;&#8221;;<br />
$arItems = array();<br />
$itemCount = 0;</p>
<p>// ********* Start User-Defined Vars ************<br />
// rss url goes here<br />
$uFile = &#8220;http://glurt.com/feed&#8221;;<br />
// descriptions (true or false) goes here<br />
$bDesc = true;<br />
// font goes here<br />
$uFont = &#8220;Verdana, Arial, Helvetica, sans-serif&#8221;;<br />
$uFontSize = &#8220;2&#8243;;<br />
// ********* End User-Defined Vars **************</p>
<p>function startElement($parser, $name, $attrs) {<br />
global $curTag;</p>
<p>$curTag .= &#8220;^$name&#8221;;</p>
<p>}</p>
<p>function endElement($parser, $name) {<br />
global $curTag;</p>
<p>$caret_pos = strrpos($curTag,&#8217;^');</p>
<p>$curTag = substr($curTag,0,$caret_pos);</p>
<p>}</p>
<p>function characterData($parser, $data) { global $curTag; // get the Channel information first<br />
global $sTitle, $sLink, $sDescription;<br />
$titleKey = &#8220;^RSS^CHANNEL^TITLE&#8221;;<br />
$linkKey = &#8220;^RSS^CHANNEL^LINK&#8221;;<br />
$descKey = &#8220;^RSS^CHANNEL^DESCRIPTION&#8221;;<br />
if ($curTag == $titleKey) {<br />
$sTitle = $data;<br />
}<br />
elseif ($curTag == $linkKey) {<br />
$sLink = $data;<br />
}<br />
elseif ($curTag == $descKey) {<br />
$sDescription = $data;<br />
}</p>
<p>// now get the items<br />
global $arItems, $itemCount;<br />
$itemTitleKey = &#8220;^RSS^CHANNEL^ITEM^TITLE&#8221;;<br />
$itemLinkKey = &#8220;^RSS^CHANNEL^ITEM^LINK&#8221;;<br />
$itemDescKey = &#8220;^RSS^CHANNEL^ITEM^DESCRIPTION&#8221;;</p>
<p>if ($curTag == $itemTitleKey) {<br />
// make new xItem<br />
$arItems[$itemCount] = new xItem();</p>
<p>// set new item object&#8217;s properties<br />
$arItems[$itemCount]-&gt;xTitle = $data;<br />
}<br />
elseif ($curTag == $itemLinkKey) {<br />
$arItems[$itemCount]-&gt;xLink = $data;<br />
}<br />
elseif ($curTag == $itemDescKey) {<br />
$arItems[$itemCount]-&gt;xDescription = $data;<br />
// increment item counter<br />
$itemCount++;<br />
}<br />
}</p>
<p>// main loop<br />
$xml_parser = xml_parser_create();<br />
xml_set_element_handler($xml_parser, &#8220;startElement&#8221;, &#8220;endElement&#8221;);<br />
xml_set_character_data_handler($xml_parser, &#8220;characterData&#8221;);<br />
if (!($fp = fopen($uFile,&#8221;r&#8221;))) {<br />
die (&#8221;could not open RSS for input&#8221;);<br />
}<br />
while ($data = fread($fp, 4096)) {<br />
if (!xml_parse($xml_parser, $data, feof($fp))) {<br />
die(sprintf(&#8221;XML error: %s at line %d&#8221;, xml_error_string(xml_get_error_code($xml_parser)), xml_get_current_line_number($xml_parser)));<br />
}<br />
}<br />
xml_parser_free($xml_parser);</p>
<p>// write out the items in sidebar<br />
?&gt;</p></blockquote>
<p>The last part is to add output code into our sidebar, find &lt;div id=&#8221;sidebar&#8221;&gt; html code and enter the code below between &lt;div id=&#8221;sidebar&#8221;&gt; and &lt;/div&gt; tag on any place inside your sidebar.</p>
<blockquote><p>&lt;?php<br />
for ($i=0;$i&lt;4;$i++) {<br />
$txItem = $arItems[$i];<br />
?&gt;</p>
<p>&lt;h3&gt;&lt;a href = &#8220;&lt;?=$txItem-&gt;xLink ?&gt;&#8221;&gt;&lt;?php echo(trim($txItem-&gt;xTitle)); ?&gt;&lt;/h3&gt;&lt;/a&gt;<br />
&lt;p&gt;&lt;?php<br />
$texter = trim($txItem-&gt;xDescription);<br />
if(strlen($texter ) &gt; 120) {<br />
$texter = substr($texter , 0, 120);<br />
}<br />
echo &#8221;.$texter.&#8217;&lt;br&gt;&lt;a href = &#8220;&#8216;.$txItem-&gt;xLink.&#8217;&#8221;&gt; Read more &lt;/a&gt;&#8217;;<br />
?&gt;<br />
&lt;/p&gt;</p>
<p>&lt;?</p>
<p>}<br />
?&gt;</p></blockquote>
<p>Now we have pretty RSS code shown from somewhere on our wordpress sidebar .</p>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/wordpress-sidebar-rss-feed-tutorial/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress template from scratch tutorial #2</title>
		<link>http://glurt.com/wordpress-template-from-scratch-tutorial-2</link>
		<comments>http://glurt.com/wordpress-template-from-scratch-tutorial-2#comments</comments>
		<pubDate>Sun, 05 Jul 2009 11:29:59 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress design]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=33</guid>
		<description><![CDATA[Hey,  please read Wordpress template from scratch tutorial #1 and learn about possible wordpress theme files structure.
Now it is a good time to create simple wordpress template, we will create basic wordpress template output in this tutorial.
Before we will start, please create some folder and name it with any name , you can name your [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-34" title="icon_big" src="http://glurt.com/wp-content/uploads/2009/07/icon_big-300x267.png" alt="icon_big" width="300" height="267" />Hey,  please read <a href="http://glurt.com/wordpress-template-from-scratch-tutorial-1" target="_blank">Wordpress template from scratch tutorial #1</a> and learn about possible wordpress theme files structure.</p>
<p>Now it is a good time to create simple wordpress template, we will create basic wordpress template output in this tutorial.</p>
<p>Before we will start, please create some folder and name it with any name , you can name your template folder &#8220;glurt&#8221;, all files described below should be located in that directory.</p>
<p>This is basic template tutorial, and you will not see any graphics here.</p>
<p>Lets start from our files skeleton :</p>
<h2><strong>header.php</strong></h2>
<blockquote><p>&lt;html&gt;<br />
&lt;!DOCTYPE html PUBLIC &#8220;-//W3C//DTD XHTML 1.0 Transitional//EN&#8221; &#8220;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&#8221;&gt;<br />
&lt;html xmlns=&#8221;http://www.w3.org/1999/xhtml&#8221; &lt;?php language_attributes(); ?&gt;&gt;</p>
<p>&lt;head profile=&#8221;http://gmpg.org/xfn/11&#8243;&gt;<br />
&lt;meta http-equiv=&#8221;Content-Type&#8221; content=&#8221;&lt;?php bloginfo(&#8217;html_type&#8217;); ?&gt;; charset=&lt;?php bloginfo(&#8217;charset&#8217;); ?&gt;&#8221; /&gt;</p>
<p>&lt;title&gt;&lt;?php wp_title(&#8217;&amp;laquo;&#8217;, true, &#8216;right&#8217;); ?&gt; &lt;?php bloginfo(&#8217;name&#8217;); ?&gt;&lt;/title&gt;</p>
<p>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;&lt;?php bloginfo(&#8217;stylesheet_url&#8217;); ?&gt;&#8221; type=&#8221;text/css&#8221; media=&#8221;screen&#8221; /&gt;<br />
&lt;link rel=&#8221;pingback&#8221; href=&#8221;&lt;?php bloginfo(&#8217;pingback_url&#8217;); ?&gt;&#8221; /&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;div id=&#8221;page&#8221;&gt;<br />
&lt;div id=&#8221;header&#8221;&gt;<br />
&lt;h1&gt;&lt;a href=&#8221;&lt;?php echo get_option(&#8217;home&#8217;); ?&gt;/&#8221;&gt;&lt;?php bloginfo(&#8217;name&#8217;); ?&gt;&lt;/a&gt;&lt;/h1&gt;<br />
&lt;/div&gt;</p></blockquote>
<p><strong>&lt;?php language_attributes(); ?&gt; </strong>defines blog language attributes<strong> </strong>automatically defined with wordpress, language attributes set to en by default</p>
<p><strong>&lt;?php bloginfo(&#8217;html_type&#8217;); ?&gt;</strong> Defines html type</p>
<p><strong>&lt;?php bloginfo(&#8217;charset&#8217;); ?&gt;</strong> Like it sounds defines charset, you can remove this line and add manually your charset, like utf-8</p>
<p><strong>&lt;title&gt;&lt;?php wp_title(&#8217;&amp;laquo;&#8217;, true, &#8216;right&#8217;); ?&gt; &lt;?php bloginfo(&#8217;name&#8217;); ?&gt;&lt;/title&gt;</strong> This is our title, changed dynamically once someone clicks on any post or blog page or category</p>
<p><strong>&lt;link rel=&#8221;stylesheet&#8221; href=&#8221;&lt;?php bloginfo(&#8217;stylesheet_url&#8217;); ?&gt;&#8221; type=&#8221;text/css&#8221; media=&#8221;screen&#8221; /&gt;<br />
&lt;link rel=&#8221;pingback&#8221; href=&#8221;&lt;?php bloginfo(&#8217;pingback_url&#8217;); ?&gt;&#8221; /&gt;</strong></p>
<p>First line defines our stylesheet file location &#8211; style.css, the second line used for pingbacks definition.</p>
<p><strong>&lt;div id=&#8221;header&#8221;&gt;<br />
&lt;h1&gt;&lt;a href=&#8221;&lt;?php echo get_option(&#8217;home&#8217;); ?&gt;/&#8221;&gt;&lt;?php bloginfo(&#8217;name&#8217;); ?&gt;&lt;/a&gt;&lt;/h1&gt;<br />
&lt;/div&gt;</strong></p>
<p>This is our blog name output, links back to the homepage.</p>
<h2><strong>sidebar.php</strong></h2>
<p>There is two options to create wordpress sidebar, we could use wordpress API to read all the elements manually, and another option is to create functions file and define dynamic sidebar there, once activated, you can add widgets from your wordpress admin and all the widgets will be shown automatically on your blog&#8217;s sidebar.</p>
<p><strong>Manual sidebar definition code</strong></p>
<blockquote><p>&lt;div id=&#8221;sidebar&#8221;&gt;<br />
&lt;h2&gt;&lt;?php _e(&#8217;Categories&#8217;); ?&gt;&lt;/h2&gt;<br />
&lt;ul&gt;<br />
&lt;?php wp_list_cats(&#8217;sort_column=name&amp;optioncount=1&amp;hierarchical=0&#8242;); ?&gt;<br />
&lt;/ul&gt;</p>
<p>&lt;h2&gt;&lt;?php _e(&#8217;Archives&#8217;); ?&gt;&lt;/h2&gt;<br />
&lt;ul&gt;<br />
&lt;?php wp_get_archives(&#8217;type=monthly&#8217;); ?&gt;<br />
&lt;/ul&gt;<br />
&lt;/div&gt;</p></blockquote>
<p><strong>&lt;?php wp_list_cats(&#8217;sort_column=name&amp;optioncount=1&amp;hierarchical=0&#8242;); ?&gt;</strong> this api code will output categories not in hierarchical structure</p>
<p>You can exclude one or more categories from being listed by adding<strong> </strong>exclude=1  variable in API url , for example</p>
<p><strong>&lt;?php wp_list_cats(&#8217;sort_column=name&amp;optioncount=1&amp;hierarchical=0&amp;exclude=1&#8242;); ?&gt;</strong></p>
<p>&lt;?php wp_get_archives(&#8217;type=monthly&#8217;); ?&gt; This code will output monthly archives.</p>
<p><strong>Creating automatic sidebar register sidebar.</strong></p>
<p>create file called functions.php in your template directory and enter the lines <strong><br />
</strong></p>
<blockquote><p>&lt;?php<br />
automatic_feed_links();<br />
if ( function_exists(&#8217;register_sidebar&#8217;) ) {<br />
register_sidebar(array(<br />
&#8216;before_widget&#8217; =&gt; &#8216;&lt;li id=&#8221;%1$s&#8221;&gt;&#8217;,<br />
&#8216;after_widget&#8217; =&gt; &#8216;&lt;/li&gt;&#8217;,<br />
&#8216;before_title&#8217; =&gt; &#8216;&lt;h2&gt;&#8217;,<br />
&#8216;after_title&#8217; =&gt; &#8216;&lt;/h2&gt;&#8217;,<br />
));<br />
}<br />
?&gt;</p></blockquote>
<p>Next open sidebar.php and enter the code</p>
<blockquote><p>&lt;div id=&#8221;sidebar&#8221;&gt;<br />
&lt;?php<br />
if ( !function_exists(&#8217;dynamic_sidebar&#8217;) || !dynamic_sidebar() ) : ?&gt;<br />
&lt;h2&gt;&lt;?php _e(&#8217;Categories&#8217;); ?&gt;&lt;/h2&gt;</p>
<p>&lt;ul&gt;</p>
<p>&lt;?php wp_list_cats(&#8217;sort_column=name&amp;optioncount=1&amp;hierarchical=0&#8242;); ?&gt;</p>
<p>&lt;/ul&gt;</p>
<p>&lt;h2&gt;&lt;?php _e(&#8217;Archives&#8217;); ?&gt;&lt;/h2&gt;</p>
<p>&lt;ul&gt;</p>
<p>&lt;?php wp_get_archives(&#8217;type=monthly&#8217;); ?&gt;</p>
<p>&lt;/ul&gt;<br />
&lt;?<br />
endif;<br />
?&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>Now when the dynamic sidebar defined, all the widgets will be shown on our sidebar, and if it is not defined, API code will be shown.</p>
<h2><strong>index.php</strong></h2>
<p>Now is our index.php, index.php is our blog&#8217;s homepage and so called template bootstrap. Enter these lines into your index.php</p>
<blockquote><p>&lt;?php</p>
<p>get_header(); ?&gt;<br />
&lt;div id=&#8221;content&#8221; &gt;</p>
<p>&lt;?php if (have_posts()) : ?&gt;</p>
<p>&lt;?php while (have_posts()) : the_post(); ?&gt;</p>
<p>&lt;div&gt;<br />
&lt;h2&gt;&lt;a href=&#8221;&lt;?php the_permalink() ?&gt;&#8221; rel=&#8221;bookmark&#8221; title=&#8221;Permanent Link to &lt;?php the_title_attribute(); ?&gt;&#8221;&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;</p>
<p>&lt;small&gt;&lt;?php the_time(&#8217;l, F jS, Y&#8217;) ?&gt; &lt;!&#8211; by &lt;?php the_author() ?&gt; &#8211;&gt;&lt;/small&gt;<br />
&lt;div&gt;<br />
&lt;?php the_content(&#8217;Read the rest of this entry &amp;raquo;&#8217;); ?&gt;<br />
&lt;/div&gt;</p>
<p>&lt;p&gt;&lt;?php the_tags(&#8217;Tags: &#8216;, &#8216;, &#8216;, &#8216;&lt;br /&gt;&#8217;); ?&gt; Posted in &lt;?php the_category(&#8217;, &#8216;) ?&gt; | &lt;?php edit_post_link(&#8217;Edit&#8217;, &#8221;, &#8216; | &#8216;); ?&gt;  &lt;?php comments_popup_link(&#8217;No Comments &amp;#187;&#8217;, &#8216;1 Comment &amp;#187;&#8217;, &#8216;% Comments &amp;#187;&#8217;); ?&gt;&lt;/p&gt;</p>
<p>&lt;/div&gt;<br />
&lt;?php endwhile; ?&gt;</p>
<p>&lt;?php else : ?&gt;<br />
&lt;div&gt;<br />
&lt;h2&gt;Not Found&lt;/h2&gt;<br />
&lt;p&gt;Sorry, but you are looking for something that isn&#8217;t here.&lt;/p&gt;<br />
&lt;?php get_search_form(); ?&gt;<br />
&lt;/div&gt;<br />
&lt;?php endif; ?&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;?php get_sidebar(); ?&gt;</p>
<p>&lt;?php get_footer(); ?&gt;</p></blockquote>
<p>The index.php code reads post entries and outputs it in our blog&#8217;s homepage.  If specified category or archive, it will call all the post in the specified category or achive.</p>
<h2><strong>footer.php</strong></h2>
<p>Footer is a code that closes every single and multiple page, it&#8217;s a bottom part of our wordpress blog.Copy and paste this code into your footer.php file</p>
<p>&lt;div id=&#8221;footer&#8221;&gt;</p>
<p>&lt;b&gt;<strong><cite>&lt;?php</cite> bloginfo(&#8217;name&#8217;);<cite>?&gt; &amp;copy;</cite></strong>&lt;/b&gt;<br />
&lt;/div&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p>
<p>&lt;b&gt;<strong><cite>&lt;?php</cite> bloginfo(&#8217;name&#8217;);<cite>?&gt; &amp;copy;</cite></strong>&lt;/b&gt; &#8211; we just printed our blog name and the copyright symbol.</p>
<p>Now when the footer.php created , we can create our CSS style.css file.</p>
<h2><strong>style.css</strong></h2>
<p>style.css is our template style sheet file. You can copy and paste code below and save it as your style.css file in template directory.</p>
<p>body {<br />
font-size: 12px;<br />
font-family: Arial, Helvetica, Tahoma, sans-serif;<br />
background: #fff url(&#8217;images/body_bg.png&#8217;) repeat-x;<br />
color: #333;<br />
text-align: center;<br />
margin: 0 0 20px 0;<br />
padding: 0;<br />
}</p>
<p>#page {<br />
background-color: white;<br />
border: 1px solid #959596;<br />
text-align: left;<br />
background-color: white;<br />
margin: 20px auto;<br />
padding: 0;<br />
width: 900px;<br />
border: 1px solid #959596;<br />
}</p>
<p>#header {<br />
border: 2px #a2a2a2 solid;<br />
}</p>
<p>#content {<br />
width: 75%;<br />
border: 2px #a2a2a2 solid;<br />
float: left;</p>
<p>}</p>
<p>#sidebar {<br />
width: 23%;<br />
border: 2px #a2a2a2 solid;<br />
float: right;<br />
}</p>
<p>#delimiter {<br />
clear: both;<br />
}</p>
<p>#footer {<br />
padding: 0;<br />
margin: 0 auto;<br />
width: 760px;<br />
clear: both;<br />
}</p>
<p>.title {<br />
font-size: 11pt;<br />
font-family: verdana;<br />
font-weight: bold;<br />
}</p>
<p>html&gt;body .entry ul {<br />
margin-left: 0px;<br />
padding: 0 0 0 30px;<br />
list-style: none;<br />
padding-left: 10px;<br />
text-indent: -10px;<br />
}</p>
<p>html&gt;body .entry li {<br />
margin: 7px 0 8px 10px;<br />
}</p>
<p>.entry ul li:before, #sidebar ul ul li:before {<br />
content: &#8220;\00BB \0020&#8243;;<br />
}</p>
<p>.entry ol {<br />
padding: 0 0 0 35px;<br />
margin: 0;<br />
}</p>
<p>.entry ol li {<br />
margin: 0;<br />
padding: 0;<br />
}</p>
<p>.entry form {<br />
text-align:center;<br />
}<br />
.post {<br />
margin: 0 0 40px;<br />
text-align: justify;<br />
padding:1em;<br />
}</p>
<p>Our next #3 tutorial will be on editing stylesheet.css and adding additional code into our template.</p>
<p>Good luck</p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/wordpress-template-from-scratch-tutorial-2/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress SEO tutorial</title>
		<link>http://glurt.com/wordpress-seo-tutorial</link>
		<comments>http://glurt.com/wordpress-seo-tutorial#comments</comments>
		<pubDate>Fri, 03 Jul 2009 20:37:04 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[SEO]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress seo]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=24</guid>
		<description><![CDATA[Wordpress is a free powerful content management blog system, it allows to skyrocket your business website with the right tools. Once you installed wordpress it is not enough to make your website visible on the web. We prepared some useful tips on search engine optimization for your wordpress blog. Before you read our article, please [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-25" title="seo" src="http://glurt.com/wp-content/uploads/2009/07/seo-300x225.jpg" alt="seo" width="300" height="225" />Wordpress is a free powerful content management blog system, it allows to skyrocket your business website with the right tools. Once you installed wordpress it is not enough to make your website visible on the web. We prepared some useful tips on search engine optimization for your wordpress blog. Before you read our article, please read <a href="http://www.google.com/support/webmasters/bin/answer.py?answer=35769" target="_blank">google seo TOS</a> carefully. Now you should verify your blog with google webmaster tools. Login webmaster tools, click on add site, enter your blog url. You will be asked to choose verification method. Use &#8220;verify by meta&#8221; method. Copy meta tag provided, login wordpress admin, appearance, editor, click on header.php and paste the meta code before &lt;/head&gt; tag.</p>
<p><strong>Wordpress articles and HTML optimization. </strong></p>
<p>First of all find good web 2.0 template and install it on your wordpress blog. It is important and if your template has less errors, it will rank better with google search engine.</p>
<p>You just installed your wordpress content management system and inserted a first article into it. What happens to the html code ? After article insertion, your article gets it&#8217;s unique title, the name of an article. So , what&#8217;s about description and keywords for your article ? Title, description and keywords are three basic key components for your article to be ranked high in google, install <a href="http://wordpress.org/extend/plugins/all-in-one-seo-pack/" target="_blank">seo tool </a>to create keywords and description for each article inserted.</p>
<p><strong>Human readible permalinks</strong></p>
<p>Well, the idea of SEO is simple, you should create rellevant keywords cloud in every article that you create. Wordpress Permalinks configuration may help you in SEO ranking, go to your wordpress admin, click on settings, permalinks, select custom structure and insert this line %postname%.  Save, and you have now human readible permalinks, it creates very nice keywords cloud when you use same keywords in title, description and keywords.</p>
<p><strong>Google XML sitemaps generator</strong></p>
<p><a href="http://wordpress.org/extend/plugins/google-sitemap-generator/" target="_blank">Google xml sitemaps generator</a> will create sitemap of your blog and will inform google on every post you add to your blog. Before you create your sitemap, make sure you created quality and unique content, <a href="http://wordpress.org/extend/plugins/google-sitemap-generator/" target="_blank">download xml sitemap generator</a> wordpress blugin, go to your wordpress admin panel, plugins, and activate this plugin. Once plugin activated, go to settings, click on sitemap generator, it will ask you to generate sitemap for the first time, click on create sitemap. Now go to google webmaster tools and add sitemap of your website. You will be asked for sitemap url, the sitemap url could be found in your blog&#8217;s root directory, and file named sitemap.xml.</p>
<p>Before adding your website link somewhere, check where traffic comes from, avoid submitting your links to websites that support warez and others that violating search engines rules.</p>
<p>If you have any questions , or SEO ideas, write in comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/wordpress-seo-tutorial/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Wordpress custom login page tutorial</title>
		<link>http://glurt.com/wordpress-custom-login-page-tutorial</link>
		<comments>http://glurt.com/wordpress-custom-login-page-tutorial#comments</comments>
		<pubDate>Fri, 03 Jul 2009 14:44:16 +0000</pubDate>
		<dc:creator>glurt</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress design]]></category>

		<guid isPermaLink="false">http://glurt.com/?p=17</guid>
		<description><![CDATA[This tuorial is an attempt to create nice looking wordpress login page, we will show you how we edited wp-login.php file for default wordpress theme (kubrick theme) and you will be able to modify your own theme.
So, here is complete PHP and html code of wp-login.php file.  Before you copy and paste this code into [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-18" title="wp-login" src="http://glurt.com/wp-content/uploads/2009/07/wp-login.jpg" alt="wp-login" width="237" height="249" />This tuorial is an attempt to create nice looking wordpress login page, we will show you how we edited wp-login.php file for default wordpress theme (kubrick theme) and you will be able to modify your own theme.</p>
<p>So, here is complete PHP and html code of wp-login.php file.  Before you copy and paste this code into your own wp-login.php file make sure you saved original wp-login.php file, we commented important code parts , so if you want to understand deeper, please read our comments. Or you can compare to your original wp-login.php to see the changes.</p>
<blockquote><p>&lt;?php<br />
/**<br />
* WordPress User Page<br />
*<br />
* Handles authentication, registering, resetting passwords, forgot password,<br />
* and other user handling.<br />
*<br />
* @package WordPress<br />
*/</p>
<p>/** Make sure that the WordPress bootstrap has run before continuing. */<br />
require( dirname(__FILE__) . &#8216;/wp-load.php&#8217; );</p>
<p>// Redirect to https login if forced to use SSL<br />
if ( force_ssl_admin() &amp;&amp; !is_ssl() ) {<br />
if ( 0 === strpos($_SERVER['REQUEST_URI'], &#8216;http&#8217;) ) {<br />
wp_redirect(preg_replace(&#8217;|^http://|&#8217;, &#8216;https://&#8217;, $_SERVER['REQUEST_URI']));<br />
exit();<br />
} else {<br />
wp_redirect(&#8217;https://&#8217; . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);<br />
exit();<br />
}<br />
}</p>
<p>/**<br />
* Outputs the header for the login page.<br />
*<br />
* @uses do_action() Calls the &#8216;login_head&#8217; for outputting HTML in the Log In<br />
*        header.<br />
* @uses apply_filters() Calls &#8216;login_headerurl&#8217; for the top login link.<br />
* @uses apply_filters() Calls &#8216;login_headertitle&#8217; for the top login title.<br />
* @uses apply_filters() Calls &#8216;login_message&#8217; on the message to display in the<br />
*        header.<br />
* @uses $error The error global, which is checked for displaying errors.<br />
*<br />
* @param string $title Optional. WordPress Log In Page title to display in<br />
*        &lt;title/&gt; element.<br />
* @param string $message Optional. Message to display in header.<br />
* @param WP_Error $wp_error Optional. WordPress Error Object<br />
*/<br />
function login_header($title = &#8216;Log In&#8217;, $message = &#8221;, $wp_error = &#8221;) {<br />
global $error, $is_iphone;</p>
<p>// Don&#8217;t index any of these forms<br />
add_filter( &#8216;pre_option_blog_public&#8217;, create_function( &#8216;$a&#8217;, &#8216;return 0;&#8217; ) );<br />
add_action( &#8216;login_head&#8217;, &#8216;noindex&#8217; );</p>
<p>if ( empty($wp_error) )<br />
$wp_error = new WP_Error();</p>
<p>do_action(&#8217;login_head&#8217;); ?&gt;<br />
&lt;? include(&#8221;wp-content/themes/default/header.php&#8221;); ?&gt;<br />
&lt;div id=&#8221;content&#8221;&gt;<br />
&lt;body&gt;<br />
&lt;div id=&#8221;login&#8221;&gt;<br />
&lt;?php<br />
$message = apply_filters(&#8217;login_message&#8217;, $message);<br />
if ( !empty( $message ) ) echo $message . &#8220;\n&#8221;;</p>
<p>// Incase a plugin uses $error rather than the $errors object<br />
if ( !empty( $error ) ) {<br />
$wp_error-&gt;add(&#8217;error&#8217;, $error);<br />
unset($error);<br />
}</p>
<p>if ( $wp_error-&gt;get_error_code() ) {<br />
$errors = &#8221;;<br />
$messages = &#8221;;<br />
foreach ( $wp_error-&gt;get_error_codes() as $code ) {<br />
$severity = $wp_error-&gt;get_error_data($code);<br />
foreach ( $wp_error-&gt;get_error_messages($code) as $error ) {<br />
if ( &#8216;message&#8217; == $severity )<br />
$messages .= &#8216;    &#8217; . $error . &#8220;&lt;br /&gt;\n&#8221;;<br />
else<br />
$errors .= &#8216;    &#8217; . $error . &#8220;&lt;br /&gt;\n&#8221;;<br />
}<br />
}<br />
if ( !empty($errors) )<br />
echo &#8216;&lt;div style=&#8221;margin-left:3em;margin-top:3em;color:red;&#8221; id=&#8221;login_error&#8221;&gt;&#8217; . apply_filters(&#8217;login_errors&#8217;, $errors) . &#8220;&lt;/div&gt;\n&#8221;;<br />
if ( !empty($messages) )<br />
echo &#8216;&lt;p style=&#8221;margin-left:3em;margin-top:3em;&#8221;&gt;&#8217; . apply_filters(&#8217;login_messages&#8217;, $messages) . &#8220;&lt;/p&gt;\n&#8221;;<br />
}<br />
} // End of login_header()</p>
<p>/**<br />
* Handles sending password retrieval email to user.<br />
*<br />
* @uses $wpdb WordPress Database object<br />
*<br />
* @return bool|WP_Error True: when finish. WP_Error on error<br />
*/<br />
function retrieve_password() {<br />
global $wpdb;</p>
<p>$errors = new WP_Error();</p>
<p>if ( empty( $_POST['user_login'] ) &amp;&amp; empty( $_POST['user_email'] ) )<br />
$errors-&gt;add(&#8217;empty_username&#8217;, __(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: Enter a username or e-mail address.&#8217;));</p>
<p>if ( strpos($_POST['user_login'], &#8216;@&#8217;) ) {<br />
$user_data = get_user_by_email(trim($_POST['user_login']));<br />
if ( empty($user_data) )<br />
$errors-&gt;add(&#8217;invalid_email&#8217;, __(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: There is no user registered with that email address.&#8217;));<br />
} else {<br />
$login = trim($_POST['user_login']);<br />
$user_data = get_userdatabylogin($login);<br />
}</p>
<p>do_action(&#8217;lostpassword_post&#8217;);</p>
<p>if ( $errors-&gt;get_error_code() )<br />
return $errors;</p>
<p>if ( !$user_data ) {<br />
$errors-&gt;add(&#8217;invalidcombo&#8217;, __(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: Invalid username or e-mail.&#8217;));<br />
return $errors;<br />
}</p>
<p>// redefining user_login ensures we return the right case in the email<br />
$user_login = $user_data-&gt;user_login;<br />
$user_email = $user_data-&gt;user_email;</p>
<p>do_action(&#8217;retreive_password&#8217;, $user_login);  // Misspelled and deprecated<br />
do_action(&#8217;retrieve_password&#8217;, $user_login);</p>
<p>$allow = apply_filters(&#8217;allow_password_reset&#8217;, true, $user_data-&gt;ID);</p>
<p>if ( ! $allow )<br />
return new WP_Error(&#8217;no_password_reset&#8217;, __(&#8217;Password reset is not allowed for this user&#8217;));<br />
else if ( is_wp_error($allow) )<br />
return $allow;</p>
<p>$key = $wpdb-&gt;get_var($wpdb-&gt;prepare(&#8221;SELECT user_activation_key FROM $wpdb-&gt;users WHERE user_login = %s&#8221;, $user_login));<br />
if ( empty($key) ) {<br />
// Generate something random for a key&#8230;<br />
$key = wp_generate_password(20, false);<br />
do_action(&#8217;retrieve_password_key&#8217;, $user_login, $key);<br />
// Now insert the new md5 key into the db<br />
$wpdb-&gt;update($wpdb-&gt;users, array(&#8217;user_activation_key&#8217; =&gt; $key), array(&#8217;user_login&#8217; =&gt; $user_login));<br />
}<br />
$message = __(&#8217;Someone has asked to reset the password for the following site and username.&#8217;) . &#8220;\r\n\r\n&#8221;;<br />
$message .= get_option(&#8217;siteurl&#8217;) . &#8220;\r\n\r\n&#8221;;<br />
$message .= sprintf(__(&#8217;Username: %s&#8217;), $user_login) . &#8220;\r\n\r\n&#8221;;<br />
$message .= __(&#8217;To reset your password visit the following address, otherwise just ignore this email and nothing will happen.&#8217;) . &#8220;\r\n\r\n&#8221;;<br />
$message .= site_url(&#8221;wp-login.php?action=rp&amp;key=$key&#8221;, &#8216;login&#8217;) . &#8220;\r\n&#8221;;</p>
<p>$title = sprintf(__(&#8217;[%s] Password Reset&#8217;), get_option(&#8217;blogname&#8217;));</p>
<p>$title = apply_filters(&#8217;retrieve_password_title&#8217;, $title);<br />
$message = apply_filters(&#8217;retrieve_password_message&#8217;, $message, $key);</p>
<p>if ( $message &amp;&amp; !wp_mail($user_email, $title, $message) )<br />
die(&#8217;&lt;p&gt;&#8217; . __(&#8217;The e-mail could not be sent.&#8217;) . &#8220;&lt;br /&gt;\n&#8221; . __(&#8217;Possible reason: your host may have disabled the mail() function&#8230;&#8217;) . &#8216;&lt;/p&gt;&#8217;);</p>
<p>return true;<br />
}</p>
<p>/**<br />
* Handles resetting the user&#8217;s password.<br />
*<br />
* @uses $wpdb WordPress Database object<br />
*<br />
* @param string $key Hash to validate sending user&#8217;s password<br />
* @return bool|WP_Error<br />
*/<br />
function reset_password($key) {<br />
global $wpdb;</p>
<p>$key = preg_replace(&#8217;/[^a-z0-9]/i&#8217;, &#8221;, $key);</p>
<p>if ( empty( $key ) )<br />
return new WP_Error(&#8217;invalid_key&#8217;, __(&#8217;Invalid key&#8217;));</p>
<p>$user = $wpdb-&gt;get_row($wpdb-&gt;prepare(&#8221;SELECT * FROM $wpdb-&gt;users WHERE user_activation_key = %s&#8221;, $key));<br />
if ( empty( $user ) )<br />
return new WP_Error(&#8217;invalid_key&#8217;, __(&#8217;Invalid key&#8217;));</p>
<p>// Generate something random for a password&#8230;<br />
$new_pass = wp_generate_password();</p>
<p>do_action(&#8217;password_reset&#8217;, $user, $new_pass);</p>
<p>wp_set_password($new_pass, $user-&gt;ID);<br />
update_usermeta($user-&gt;ID, &#8216;default_password_nag&#8217;, true); //Set up the Password change nag.<br />
$message  = sprintf(__(&#8217;Username: %s&#8217;), $user-&gt;user_login) . &#8220;\r\n&#8221;;<br />
$message .= sprintf(__(&#8217;Password: %s&#8217;), $new_pass) . &#8220;\r\n&#8221;;<br />
$message .= site_url(&#8217;wp-login.php&#8217;, &#8216;login&#8217;) . &#8220;\r\n&#8221;;</p>
<p>$title = sprintf(__(&#8217;[%s] Your new password&#8217;), get_option(&#8217;blogname&#8217;));</p>
<p>$title = apply_filters(&#8217;password_reset_title&#8217;, $title);<br />
$message = apply_filters(&#8217;password_reset_message&#8217;, $message, $new_pass);</p>
<p>if ( $message &amp;&amp; !wp_mail($user-&gt;user_email, $title, $message) )<br />
die(&#8217;&lt;p&gt;&#8217; . __(&#8217;The e-mail could not be sent.&#8217;) . &#8220;&lt;br /&gt;\n&#8221; . __(&#8217;Possible reason: your host may have disabled the mail() function&#8230;&#8217;) . &#8216;&lt;/p&gt;&#8217;);</p>
<p>wp_password_change_notification($user);</p>
<p>return true;<br />
}</p>
<p>/**<br />
* Handles registering a new user.<br />
*<br />
* @param string $user_login User&#8217;s username for logging in<br />
* @param string $user_email User&#8217;s email address to send password and add<br />
* @return int|WP_Error Either user&#8217;s ID or error on failure.<br />
*/<br />
function register_new_user($user_login, $user_email) {<br />
$errors = new WP_Error();</p>
<p>$user_login = sanitize_user( $user_login );<br />
$user_email = apply_filters( &#8216;user_registration_email&#8217;, $user_email );</p>
<p>// Check the username<br />
if ( $user_login == &#8221; )<br />
$errors-&gt;add(&#8217;empty_username&#8217;, __(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: Please enter a username.&#8217;));<br />
elseif ( !validate_username( $user_login ) ) {<br />
$errors-&gt;add(&#8217;invalid_username&#8217;, __(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: This username is invalid.  Please enter a valid username.&#8217;));<br />
$user_login = &#8221;;<br />
} elseif ( username_exists( $user_login ) )<br />
$errors-&gt;add(&#8217;username_exists&#8217;, __(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: This username is already registered, please choose another one.&#8217;));</p>
<p>// Check the e-mail address<br />
if ($user_email == &#8221;) {<br />
$errors-&gt;add(&#8217;empty_email&#8217;, __(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: Please type your e-mail address.&#8217;));<br />
} elseif ( !is_email( $user_email ) ) {<br />
$errors-&gt;add(&#8217;invalid_email&#8217;, __(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: The email address isn&amp;#8217;t correct.&#8217;));<br />
$user_email = &#8221;;<br />
} elseif ( email_exists( $user_email ) )<br />
$errors-&gt;add(&#8217;email_exists&#8217;, __(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: This email is already registered, please choose another one.&#8217;));</p>
<p>do_action(&#8217;register_post&#8217;, $user_login, $user_email, $errors);</p>
<p>$errors = apply_filters( &#8216;registration_errors&#8217;, $errors );</p>
<p>if ( $errors-&gt;get_error_code() )<br />
return $errors;</p>
<p>$user_pass = wp_generate_password();<br />
$user_id = wp_create_user( $user_login, $user_pass, $user_email );<br />
if ( !$user_id ) {<br />
$errors-&gt;add(&#8217;registerfail&#8217;, sprintf(__(&#8217;&lt;strong&gt;ERROR&lt;/strong&gt;: Couldn&amp;#8217;t register you&#8230; please contact the &lt;a href=&#8221;mailto:%s&#8221;&gt;webmaster&lt;/a&gt; !&#8217;), get_option(&#8217;admin_email&#8217;)));<br />
return $errors;<br />
}</p>
<p>wp_new_user_notification($user_id, $user_pass);</p>
<p>return $user_id;<br />
}</p>
<p>//<br />
// Main<br />
//</p>
<p>$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : &#8216;login&#8217;;<br />
$errors = new WP_Error();</p>
<p>if ( isset($_GET['key']) )<br />
$action = &#8216;resetpass&#8217;;</p>
<p>// validate action so as to default to the login screen<br />
if ( !in_array($action, array(&#8217;logout&#8217;, &#8216;lostpassword&#8217;, &#8216;retrievepassword&#8217;, &#8216;resetpass&#8217;, &#8216;rp&#8217;, &#8216;register&#8217;, &#8216;login&#8217;)) &amp;&amp; false === has_filter(&#8217;login_form_&#8217; . $action) )<br />
$action = &#8216;login&#8217;;</p>
<p>nocache_headers();</p>
<p>header(&#8217;Content-Type: &#8216;.get_bloginfo(&#8217;html_type&#8217;).&#8217;; charset=&#8217;.get_bloginfo(&#8217;charset&#8217;));</p>
<p>if ( defined(&#8217;RELOCATE&#8217;) ) { // Move flag is set<br />
if ( isset( $_SERVER['PATH_INFO'] ) &amp;&amp; ($_SERVER['PATH_INFO'] != $_SERVER['PHP_SELF']) )<br />
$_SERVER['PHP_SELF'] = str_replace( $_SERVER['PATH_INFO'], &#8221;, $_SERVER['PHP_SELF'] );</p>
<p>$schema = ( isset($_SERVER['HTTPS']) &amp;&amp; strtolower($_SERVER['HTTPS']) == &#8216;on&#8217; ) ? &#8216;https://&#8217; : &#8216;http://&#8217;;<br />
if ( dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) != get_option(&#8217;siteurl&#8217;) )<br />
update_option(&#8217;siteurl&#8217;, dirname($schema . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']) );<br />
}</p>
<p>//Set a cookie now to see if they are supported by the browser.<br />
setcookie(TEST_COOKIE, &#8216;WP Cookie check&#8217;, 0, COOKIEPATH, COOKIE_DOMAIN);<br />
if ( SITECOOKIEPATH != COOKIEPATH )<br />
setcookie(TEST_COOKIE, &#8216;WP Cookie check&#8217;, 0, SITECOOKIEPATH, COOKIE_DOMAIN);</p>
<p>// allow plugins to override the default actions, and to add extra actions if they want<br />
do_action(&#8217;login_form_&#8217; . $action);</p>
<p>$http_post = (&#8217;POST&#8217; == $_SERVER['REQUEST_METHOD']);<br />
switch ($action) {</p>
<p>case &#8216;logout&#8217; :<br />
check_admin_referer(&#8217;log-out&#8217;);<br />
wp_logout();</p>
<p>$redirect_to = &#8216;wp-login.php?loggedout=true&#8217;;<br />
if ( isset( $_REQUEST['redirect_to'] ) )<br />
$redirect_to = $_REQUEST['redirect_to'];</p>
<p>wp_safe_redirect($redirect_to);<br />
exit();</p>
<p>break;</p>
<p>case &#8216;lostpassword&#8217; :<br />
case &#8216;retrievepassword&#8217; :<br />
if ( $http_post ) {<br />
$errors = retrieve_password();<br />
if ( !is_wp_error($errors) ) {<br />
wp_redirect(&#8217;wp-login.php?checkemail=confirm&#8217;);<br />
exit();<br />
}<br />
}</p>
<p>if ( isset($_GET['error']) &amp;&amp; &#8216;invalidkey&#8217; == $_GET['error'] ) $errors-&gt;add(&#8217;invalidkey&#8217;, __(&#8217;Sorry, that key does not appear to be valid.&#8217;));</p>
<p>do_action(&#8217;lost_password&#8217;);<br />
login_header(__(&#8217;Lost Password&#8217;), &#8216;&lt;p&gt;&#8217; . __(&#8217;Please enter your username or e-mail address. You will receive a new password via e-mail.&#8217;) . &#8216;&lt;/p&gt;&#8217;, $errors);</p>
<p>$user_login = isset($_POST['user_login']) ? stripslashes($_POST['user_login']) : &#8221;;</p>
<p>?&gt;</p>
<p>&lt;div style=&#8221;margin-left:3em;margin-top:3em;&#8221;&gt;<br />
&lt;form name=&#8221;lostpasswordform&#8221; id=&#8221;lostpasswordform&#8221; action=&#8221;&lt;?php echo site_url(&#8217;wp-login.php?action=lostpassword&#8217;, &#8216;login_post&#8217;) ?&gt;&#8221; method=&#8221;post&#8221;&gt;<br />
&lt;p&gt;<br />
&lt;label&gt;&lt;?php _e(&#8217;Username or E-mail:&#8217;) ?&gt;&lt;br /&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;user_login&#8221; id=&#8221;user_login&#8221; value=&#8221;&lt;?php echo esc_attr($user_login); ?&gt;&#8221; size=&#8221;20&#8243; tabindex=&#8221;10&#8243; /&gt;&lt;/label&gt;<br />
&lt;/p&gt;<br />
&lt;?php do_action(&#8217;lostpassword_form&#8217;); ?&gt;<br />
&lt;p&gt;&lt;input type=&#8221;submit&#8221; name=&#8221;wp-submit&#8221; id=&#8221;wp-submit&#8221; value=&#8221;&lt;?php esc_attr_e(&#8217;Get New Password&#8217;); ?&gt;&#8221; tabindex=&#8221;100&#8243; /&gt;&lt;/p&gt;<br />
&lt;/form&gt;</p>
<p>&lt;p id=&#8221;nav&#8221;&gt;<br />
&lt;?php if (get_option(&#8217;users_can_register&#8217;)) : ?&gt;<br />
&lt;a href=&#8221;&lt;?php echo site_url(&#8217;wp-login.php&#8217;, &#8216;login&#8217;) ?&gt;&#8221;&gt;&lt;?php _e(&#8217;Log in&#8217;) ?&gt;&lt;/a&gt; |<br />
&lt;a href=&#8221;&lt;?php echo site_url(&#8217;wp-login.php?action=register&#8217;, &#8216;login&#8217;) ?&gt;&#8221;&gt;&lt;?php _e(&#8217;Register&#8217;) ?&gt;&lt;/a&gt;<br />
&lt;?php else : ?&gt;<br />
&lt;a href=&#8221;&lt;?php echo site_url(&#8217;wp-login.php&#8217;, &#8216;login&#8217;) ?&gt;&#8221;&gt;&lt;?php _e(&#8217;Log in&#8217;) ?&gt;&lt;/a&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
try{document.getElementById(&#8217;user_login&#8217;).focus();}catch(e){}<br />
&lt;/script&gt;<br />
&lt;/div&gt;<br />
&lt;?<br />
include(&#8221;wp-content/themes/default/sidebar.php&#8221;);<br />
?&gt;<br />
&lt;?<br />
include(&#8221;wp-content/themes/default/footer.php&#8221;);<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&lt;?php<br />
break;</p>
<p>case &#8216;resetpass&#8217; :<br />
case &#8216;rp&#8217; :<br />
$errors = reset_password($_GET['key']);</p>
<p>if ( ! is_wp_error($errors) ) {<br />
wp_redirect(&#8217;wp-login.php?checkemail=newpass&#8217;);<br />
exit();<br />
}</p>
<p>wp_redirect(&#8217;wp-login.php?action=lostpassword&amp;error=invalidkey&#8217;);<br />
exit();</p>
<p>break;</p>
<p>case &#8216;register&#8217; :<br />
if ( !get_option(&#8217;users_can_register&#8217;) ) {<br />
wp_redirect(&#8217;wp-login.php?registration=disabled&#8217;);<br />
exit();<br />
}</p>
<p>$user_login = &#8221;;<br />
$user_email = &#8221;;<br />
if ( $http_post ) {<br />
require_once( ABSPATH . WPINC . &#8216;/registration.php&#8217;);</p>
<p>$user_login = $_POST['user_login'];<br />
$user_email = $_POST['user_email'];<br />
$errors = register_new_user($user_login, $user_email);<br />
if ( !is_wp_error($errors) ) {<br />
wp_redirect(&#8217;wp-login.php?checkemail=registered&#8217;);<br />
exit();<br />
}<br />
}</p>
<p>login_header(__(&#8217;Registration Form&#8217;), &#8216;&lt;p&gt;&#8217; . __(&#8217;Register For This Site&#8217;) . &#8216;&lt;/p&gt;&#8217;, $errors);<br />
?&gt;<br />
&lt;div style=&#8221;margin-left:3em;margin-top:3em;&#8221;&gt;<br />
&lt;form name=&#8221;registerform&#8221; id=&#8221;registerform&#8221; action=&#8221;&lt;?php echo site_url(&#8217;wp-login.php?action=register&#8217;, &#8216;login_post&#8217;) ?&gt;&#8221; method=&#8221;post&#8221;&gt;<br />
&lt;p&gt;<br />
&lt;label&gt;&lt;?php _e(&#8217;Username&#8217;) ?&gt;&lt;br /&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;user_login&#8221; id=&#8221;user_login&#8221; value=&#8221;&lt;?php echo esc_attr(stripslashes($user_login)); ?&gt;&#8221; size=&#8221;20&#8243; tabindex=&#8221;10&#8243; /&gt;&lt;/label&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;label&gt;&lt;?php _e(&#8217;E-mail&#8217;) ?&gt;&lt;br /&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;user_email&#8221; id=&#8221;user_email&#8221; value=&#8221;&lt;?php echo esc_attr(stripslashes($user_email)); ?&gt;&#8221; size=&#8221;25&#8243; tabindex=&#8221;20&#8243; /&gt;&lt;/label&gt;<br />
&lt;/p&gt;<br />
&lt;?php do_action(&#8217;register_form&#8217;); ?&gt;<br />
&lt;p id=&#8221;reg_passmail&#8221;&gt;&lt;?php _e(&#8217;A password will be e-mailed to you.&#8217;) ?&gt;&lt;/p&gt;<br />
&lt;br /&gt;<br />
&lt;p&gt;&lt;input type=&#8221;submit&#8221; name=&#8221;wp-submit&#8221; id=&#8221;wp-submit&#8221; value=&#8221;&lt;?php esc_attr_e(&#8217;Register&#8217;); ?&gt;&#8221; tabindex=&#8221;100&#8243; /&gt;&lt;/p&gt;<br />
&lt;/form&gt;</p>
<p>&lt;p id=&#8221;nav&#8221;&gt;<br />
&lt;a href=&#8221;&lt;?php echo site_url(&#8217;wp-login.php&#8217;, &#8216;login&#8217;) ?&gt;&#8221;&gt;&lt;?php _e(&#8217;Log in&#8217;) ?&gt;&lt;/a&gt; |<br />
&lt;a href=&#8221;&lt;?php echo site_url(&#8217;wp-login.php?action=lostpassword&#8217;, &#8216;login&#8217;) ?&gt;&#8221; title=&#8221;&lt;?php _e(&#8217;Password Lost and Found&#8217;) ?&gt;&#8221;&gt;&lt;?php _e(&#8217;Lost your password?&#8217;) ?&gt;&lt;/a&gt;<br />
&lt;/p&gt;<br />
&lt;/div&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
try{document.getElementById(&#8217;user_login&#8217;).focus();}catch(e){}<br />
&lt;/script&gt;<br />
&lt;/div&gt;<br />
&lt;?<br />
include(&#8221;wp-content/themes/default/sidebar.php&#8221;);<br />
?&gt;<br />
&lt;?<br />
include(&#8221;wp-content/themes/default/footer.php&#8221;);<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&lt;?php<br />
break;</p>
<p>case &#8216;login&#8217; :<br />
default:<br />
$secure_cookie = &#8221;;</p>
<p>// If the user wants ssl but the session is not ssl, force a secure cookie.<br />
if ( !empty($_POST['log']) &amp;&amp; !force_ssl_admin() ) {<br />
$user_name = sanitize_user($_POST['log']);<br />
if ( $user = get_userdatabylogin($user_name) ) {<br />
if ( get_user_option(&#8217;use_ssl&#8217;, $user-&gt;ID) ) {<br />
$secure_cookie = true;<br />
force_ssl_admin(true);<br />
}<br />
}<br />
}</p>
<p>if ( isset( $_REQUEST['redirect_to'] ) ) {<br />
$redirect_to = $_REQUEST['redirect_to'];<br />
// Redirect to https if user wants ssl<br />
if ( $secure_cookie &amp;&amp; false !== strpos($redirect_to, &#8216;wp-admin&#8217;) )<br />
$redirect_to = preg_replace(&#8217;|^http://|&#8217;, &#8216;https://&#8217;, $redirect_to);<br />
} else {<br />
$redirect_to = admin_url();<br />
}</p>
<p>if ( !$secure_cookie &amp;&amp; is_ssl() &amp;&amp; force_ssl_login() &amp;&amp; !force_ssl_admin() &amp;&amp; ( 0 !== strpos($redirect_to, &#8216;https&#8217;) ) &amp;&amp; ( 0 === strpos($redirect_to, &#8216;http&#8217;) ) )<br />
$secure_cookie = false;</p>
<p>$user = wp_signon(&#8221;, $secure_cookie);</p>
<p>$redirect_to = apply_filters(&#8217;login_redirect&#8217;, $redirect_to, isset( $_REQUEST['redirect_to'] ) ? $_REQUEST['redirect_to'] : &#8221;, $user);</p>
<p>if ( !is_wp_error($user) ) {<br />
// If the user can&#8217;t edit posts, send them to their profile.<br />
if ( !$user-&gt;has_cap(&#8217;edit_posts&#8217;) &amp;&amp; ( empty( $redirect_to ) || $redirect_to == &#8216;wp-admin/&#8217; || $redirect_to == admin_url() ) )<br />
$redirect_to = admin_url(&#8217;profile.php&#8217;);<br />
wp_safe_redirect($redirect_to);<br />
exit();<br />
}</p>
<p>$errors = $user;<br />
// Clear errors if loggedout is set.<br />
if ( !empty($_GET['loggedout']) )<br />
$errors = new WP_Error();</p>
<p>// If cookies are disabled we can&#8217;t log in even with a valid user+pass<br />
if ( isset($_POST['testcookie']) &amp;&amp; empty($_COOKIE[TEST_COOKIE]) )<br />
$errors-&gt;add(&#8217;test_cookie&#8217;, __(&#8221;&lt;strong&gt;ERROR&lt;/strong&gt;: Cookies are blocked or not supported by your browser. You must &lt;a href=&#8217;http://www.google.com/cookies.html&#8217;&gt;enable cookies&lt;/a&gt; to use WordPress.&#8221;));</p>
<p>// Some parts of this script use the main login form to display a message<br />
if        ( isset($_GET['loggedout']) &amp;&amp; TRUE == $_GET['loggedout'] )            $errors-&gt;add(&#8217;loggedout&#8217;, __(&#8217;You are now logged out.&#8217;), &#8216;message&#8217;);<br />
elseif    ( isset($_GET['registration']) &amp;&amp; &#8216;disabled&#8217; == $_GET['registration'] )    $errors-&gt;add(&#8217;registerdisabled&#8217;, __(&#8217;User registration is currently not allowed.&#8217;));<br />
elseif    ( isset($_GET['checkemail']) &amp;&amp; &#8216;confirm&#8217; == $_GET['checkemail'] )    $errors-&gt;add(&#8217;confirm&#8217;, __(&#8217;Check your e-mail for the confirmation link.&#8217;), &#8216;message&#8217;);<br />
elseif    ( isset($_GET['checkemail']) &amp;&amp; &#8216;newpass&#8217; == $_GET['checkemail'] )    $errors-&gt;add(&#8217;newpass&#8217;, __(&#8217;Check your e-mail for your new password.&#8217;), &#8216;message&#8217;);<br />
elseif    ( isset($_GET['checkemail']) &amp;&amp; &#8216;registered&#8217; == $_GET['checkemail'] )    $errors-&gt;add(&#8217;registered&#8217;, __(&#8217;Registration complete. Please check your e-mail.&#8217;), &#8216;message&#8217;);</p>
<p>login_header(__(&#8217;Log In&#8217;), &#8221;, $errors);</p>
<p>if ( isset($_POST['log']) )<br />
$user_login = ( &#8216;incorrect_password&#8217; == $errors-&gt;get_error_code() || &#8216;empty_password&#8217; == $errors-&gt;get_error_code() ) ? esc_attr(stripslashes($_POST['log'])) : &#8221;;<br />
?&gt;</p>
<p>&lt;?php if ( !isset($_GET['checkemail']) || !in_array( $_GET['checkemail'], array(&#8217;confirm&#8217;, &#8216;newpass&#8217;) ) ) : ?&gt;<br />
&lt;div style=&#8221;margin-left:3em;margin-top:3em;&#8221;&gt;<br />
&lt;form name=&#8221;loginform&#8221; id=&#8221;loginform&#8221; action=&#8221;&lt;?php echo site_url(&#8217;wp-login.php&#8217;, &#8216;login_post&#8217;) ?&gt;&#8221; method=&#8221;post&#8221;&gt;<br />
&lt;p&gt;<br />
&lt;label&gt;&lt;?php _e(&#8217;Username&#8217;) ?&gt;&lt;br /&gt;<br />
&lt;input type=&#8221;text&#8221; name=&#8221;log&#8221; id=&#8221;user_login&#8221; value=&#8221;&lt;?php echo esc_attr($user_login); ?&gt;&#8221; size=&#8221;20&#8243; tabindex=&#8221;10&#8243; /&gt;&lt;/label&gt;<br />
&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;label&gt;&lt;?php _e(&#8217;Password&#8217;) ?&gt;&lt;br /&gt;<br />
&lt;input type=&#8221;password&#8221; name=&#8221;pwd&#8221; id=&#8221;user_pass&#8221; value=&#8221;" size=&#8221;20&#8243; tabindex=&#8221;20&#8243; /&gt;&lt;/label&gt;<br />
&lt;/p&gt;<br />
&lt;?php do_action(&#8217;login_form&#8217;); ?&gt;<br />
&lt;p&gt;&lt;label&gt;&lt;input name=&#8221;rememberme&#8221; type=&#8221;checkbox&#8221; id=&#8221;rememberme&#8221; value=&#8221;forever&#8221; tabindex=&#8221;90&#8243; /&gt; &lt;?php esc_attr_e(&#8217;Remember Me&#8217;); ?&gt;&lt;/label&gt;&lt;/p&gt;<br />
&lt;p&gt;<br />
&lt;input type=&#8221;submit&#8221; name=&#8221;wp-submit&#8221; id=&#8221;wp-submit&#8221; value=&#8221;&lt;?php esc_attr_e(&#8217;Log In&#8217;); ?&gt;&#8221; tabindex=&#8221;100&#8243; /&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;redirect_to&#8221; value=&#8221;&lt;?php echo esc_attr($redirect_to); ?&gt;&#8221; /&gt;<br />
&lt;input type=&#8221;hidden&#8221; name=&#8221;testcookie&#8221; value=&#8221;1&#8243; /&gt;<br />
&lt;/p&gt;<br />
&lt;/form&gt;</p>
<p>&lt;?php endif; ?&gt;</p>
<p>&lt;p id=&#8221;nav&#8221;&gt;<br />
&lt;?php if ( isset($_GET['checkemail']) &amp;&amp; in_array( $_GET['checkemail'], array(&#8217;confirm&#8217;, &#8216;newpass&#8217;) ) ) : ?&gt;<br />
&lt;?php elseif (get_option(&#8217;users_can_register&#8217;)) : ?&gt;<br />
&lt;a href=&#8221;&lt;?php echo site_url(&#8217;wp-login.php?action=register&#8217;, &#8216;login&#8217;) ?&gt;&#8221;&gt;&lt;?php _e(&#8217;Register&#8217;) ?&gt;&lt;/a&gt; |<br />
&lt;a href=&#8221;&lt;?php echo site_url(&#8217;wp-login.php?action=lostpassword&#8217;, &#8216;login&#8217;) ?&gt;&#8221; title=&#8221;&lt;?php _e(&#8217;Password Lost and Found&#8217;) ?&gt;&#8221;&gt;&lt;?php _e(&#8217;Lost your password?&#8217;) ?&gt;&lt;/a&gt;<br />
&lt;?php else : ?&gt;<br />
&lt;a href=&#8221;&lt;?php echo site_url(&#8217;wp-login.php?action=lostpassword&#8217;, &#8216;login&#8217;) ?&gt;&#8221; title=&#8221;&lt;?php _e(&#8217;Password Lost and Found&#8217;) ?&gt;&#8221;&gt;&lt;?php _e(&#8217;Lost your password?&#8217;) ?&gt;&lt;/a&gt;<br />
&lt;?php endif; ?&gt;<br />
&lt;/p&gt;<br />
&lt;/div&gt;<br />
&lt;/div&gt;</p>
<p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
&lt;?php if ( $user_login ) { ?&gt;<br />
setTimeout( function(){ try{<br />
d = document.getElementById(&#8217;user_pass&#8217;);<br />
d.value = &#8221;;<br />
d.focus();<br />
} catch(e){}<br />
}, 200);<br />
&lt;?php } else { ?&gt;<br />
try{document.getElementById(&#8217;user_login&#8217;).focus();}catch(e){}<br />
&lt;?php } ?&gt;<br />
&lt;/script&gt;<br />
&lt;/div&gt;<br />
&lt;?<br />
include(&#8221;wp-content/themes/default/sidebar.php&#8221;);<br />
?&gt;<br />
&lt;?<br />
include(&#8221;wp-content/themes/default/footer.php&#8221;);<br />
?&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
&lt;?php</p>
<p>break;<br />
} // end action switch<br />
?&gt;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://glurt.com/wordpress-custom-login-page-tutorial/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
