<?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>FlexBlog on HTML5, PhoneGap, and Flash Platform! &#187; Wordpress</title>
	<atom:link href="http://flexblog.teerasej.com/category/adobe-cs-th/wordpress-th/feed/" rel="self" type="application/rss+xml" />
	<link>http://flexblog.teerasej.com</link>
	<description>Consult, training, and sharing about Adobe HTML5, PhoneGap, and Flash Platform solution, by Amaround Co., Ltd., Tel: +66 (0)86 661 5058</description>
	<lastBuildDate>Sun, 06 May 2012 14:57:36 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Get current page&#8217;s URL in WordPress</title>
		<link>http://flexblog.teerasej.com/adobe-cs-th/wordpress-th/get-current-pages-url-in-wordpress-2/</link>
		<comments>http://flexblog.teerasej.com/adobe-cs-th/wordpress-th/get-current-pages-url-in-wordpress-2/#comments</comments>
		<pubDate>Sat, 07 Jan 2012 15:00:22 +0000</pubDate>
		<dc:creator>Teerasej</dc:creator>
				<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Connect to PHP]]></category>

		<guid isPermaLink="false">http://flexblog.teerasej.com/?p=3808</guid>
		<description><![CDATA[วิธีเรียกค่า URL ของหน้า web page ที่เปิดอยู่ในปัจจุบันใน Wordpress]]></description>
			<content:encoded><![CDATA[<p>เมื่อไหร่ก็ตามที่คุณทำงานกับ WordPress เมื่อไหร่ล่ะก็ ส่วนใหญ่คุณจะต้องการใช้ข้อมูลจากระบบพื้นฐานของ WordPress อย่างเช่น</p>
<blockquote><p>URL ของ Page ที่กำลังเปิดอยู่คืออะไร?</p></blockquote>
<p>ซึ่งบ่อยครั้งที่ข้อมูลพวกนี้จะเป็นประโยชน์ในการใช้งาน API ของ Social Network อย่างเช่น <a href="http://developers.facebook.com/docs/guides/web/">Facebook Graph API ส</a>ำหรับ Website ตัวอย่างก็เช่น Social Plugin อย่าง <a href="http://developers.facebook.com/docs/reference/plugins/like">Like Button</a>.</p>
<p>ถ้าเป็นหน้า web page ที่ user เยี่ยมชมอยู่เป็นประเภท Blog Post (เรียกอีกอย่างว่า Article) คุณสามารถใช้ code template ของ WordPress ที่ชื่อ <strong>the_permalink()</strong> ได้ แต่ถ้าหน้า web page ที่เปิดอยู่เป็น WordPress Page นั้น ยังไม่มี code template ในการเรียกค่า URL ออกมา แต่<strong>คุณก็ยังสามารถใช้ code PHP ในการเรียกค่า URL ของ web page ปัจจุบันออกมาได้</strong> ตัวอย่างโค้ดอยู่ด้านล่างครับ:</p>
<pre class="brush: php; title: ; notranslate">
 echo &quot;http://&quot; . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
 </pre>
<p>ไอผมก็ไม่แน่ใจนะว่าใน version ล่าสุดของ WordPress มันจะมี code template สำหรับการเรียกค่า URL ออกมาจาก WordPress&#8217;s Page หรือเปล่า แต่ code นี้ก็สามารถทำให้คุณทำงานต่อได้อย่างไม่มีปัญหาครับ <img src='http://flexblog.teerasej.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>ต้องขอบคุณคำเฉลยนี้จาก <strong><a href="http://wordpress.stackexchange.com/users/1468/t31os">Mark / t31os</a> </strong>ใน WordPress Forum ซึ่งเป็นที่มาของ code นี้ครับ</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://flexblog.teerasej.com/adobe-cs-th/wordpress-th/get-current-pages-url-in-wordpress-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

