<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Get ID by Page Name</title>
	<atom:link href="http://www.web-templates.nu/2008/09/02/get-id-by-page-name/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 05 Oct 2011 04:38:51 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: John</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-14675</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 13 Jun 2011 12:00:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-14675</guid>
		<description>Why don&#039;t you use http://codex.wordpress.org/Function_Reference/get_page_by_title and then use the object ? 
I don&#039;t think performance would be highly impacted here and calling the db directly can lead to unexpected behavior especially if filters are applied (I&#039;m thinking of wpml&#039;s autoid feature).

Just my 2 cents.

Regards.</description>
		<content:encoded><![CDATA[<p>Why don&#8217;t you use <a href="http://codex.wordpress.org/Function_Reference/get_page_by_title" rel="nofollow">http://codex.wordpress.org/Function_Reference/get_page_by_title</a> and then use the object ?<br />
I don&#8217;t think performance would be highly impacted here and calling the db directly can lead to unexpected behavior especially if filters are applied (I&#8217;m thinking of wpml&#8217;s autoid feature).</p>
<p>Just my 2 cents.</p>
<p>Regards.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-12290</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Mon, 21 Mar 2011 05:34:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-12290</guid>
		<description>I love this function, but ran across and instance where it didn&#039;t work.  In the database there was an autosave of a post and this function reported the ID of the autosave post and not the published post.  The only way I could fix it was to delete the autosave post from the database and then it worked correctly.  Is there any way to not have to do that?</description>
		<content:encoded><![CDATA[<p>I love this function, but ran across and instance where it didn&#8217;t work.  In the database there was an autosave of a post and this function reported the ID of the autosave post and not the published post.  The only way I could fix it was to delete the autosave post from the database and then it worked correctly.  Is there any way to not have to do that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vtxyzzy on &#34;Get page content using page name&#34; &#124; Upgrade Wordpress Now</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-10981</link>
		<dc:creator>vtxyzzy on &#34;Get page content using page name&#34; &#124; Upgrade Wordpress Now</dc:creator>
		<pubDate>Sat, 29 Jan 2011 15:20:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-10981</guid>
		<description>[...] this article. Related Articles:zxdong262 on &quot;get_query_var(&#8216;paged&#8217;) doesn&#8217;t seem to work [...]</description>
		<content:encoded><![CDATA[<p>[...] this article. Related Articles:zxdong262 on &quot;get_query_var(&#8216;paged&#8217;) doesn&#8217;t seem to work [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sisir</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-10111</link>
		<dc:creator>Sisir</dc:creator>
		<pubDate>Fri, 24 Dec 2010 21:34:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-10111</guid>
		<description>I will take the idea to use it with the post type &#039;page&#039; just to be safe. And i also call the function get_id_by_page_slug() :) as it works for slugs instead of page name. Suppose if you have a page name contains two character it wont work until you give the &quot;-&quot;. 


Thanks for the idea ;)</description>
		<content:encoded><![CDATA[<p>I will take the idea to use it with the post type &#8216;page&#8217; just to be safe. And i also call the function get_id_by_page_slug() <img src='http://www.web-templates.nu/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  as it works for slugs instead of page name. Suppose if you have a page name contains two character it wont work until you give the &#8220;-&#8221;. </p>
<p>Thanks for the idea <img src='http://www.web-templates.nu/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-8304</link>
		<dc:creator>kevin</dc:creator>
		<pubDate>Wed, 22 Sep 2010 21:38:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-8304</guid>
		<description>@Bill, just tested with accents and doesnt work. The way around i found was to create a new page named &quot;Luiz&quot;, use this name in the php and then modify the page name for &quot;Luiz Varejão&quot;. Wordpress keeps the 1st name you give to the page. However spaces seem to work as wp tranlates them into &quot;-&quot; like for posts. So i tested to call my page &quot;Quem somos&quot; with &quot;Quem-somos&quot; and works. However i cant find the page slugs in the &#039;edit page&#039; admin page.

Anyway, very usefull function!</description>
		<content:encoded><![CDATA[<p>@Bill, just tested with accents and doesnt work. The way around i found was to create a new page named &#8220;Luiz&#8221;, use this name in the php and then modify the page name for &#8220;Luiz Varejão&#8221;. WordPress keeps the 1st name you give to the page. However spaces seem to work as wp tranlates them into &#8220;-&#8221; like for posts. So i tested to call my page &#8220;Quem somos&#8221; with &#8220;Quem-somos&#8221; and works. However i cant find the page slugs in the &#8216;edit page&#8217; admin page.</p>
<p>Anyway, very usefull function!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rob</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-7463</link>
		<dc:creator>rob</dc:creator>
		<pubDate>Thu, 29 Jul 2010 18:09:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-7463</guid>
		<description>thanks! nice</description>
		<content:encoded><![CDATA[<p>thanks! nice</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dwight</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-6399</link>
		<dc:creator>Dwight</dc:creator>
		<pubDate>Mon, 19 Apr 2010 06:52:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-6399</guid>
		<description>Thanks. It helps a lot. If you truly want only PAGE results and no POST results mixed in and you have pages and posts which may have the same title, use this:

	$page_name_id = $wpdb-&gt;get_var(&quot;SELECT ID FROM $wpdb-&gt;posts WHERE post_name = &#039;&quot;.$page_name.&quot;&#039; AND post_type = &#039;page&#039; &quot;);</description>
		<content:encoded><![CDATA[<p>Thanks. It helps a lot. If you truly want only PAGE results and no POST results mixed in and you have pages and posts which may have the same title, use this:</p>
<p>	$page_name_id = $wpdb-&gt;get_var(&#8220;SELECT ID FROM $wpdb-&gt;posts WHERE post_name = &#8216;&#8221;.$page_name.&#8221;&#8216; AND post_type = &#8216;page&#8217; &#8220;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hikari</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-6290</link>
		<dc:creator>Hikari</dc:creator>
		<pubDate>Sun, 04 Apr 2010 02:11:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-6290</guid>
		<description>Wordpress should have an API function for that :/</description>
		<content:encoded><![CDATA[<p>WordPress should have an API function for that :/</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bensbury</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-6040</link>
		<dc:creator>Bensbury</dc:creator>
		<pubDate>Tue, 23 Feb 2010 01:33:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-6040</guid>
		<description>Hi, I found this example here in the comments:
(http://www.arkinex.com/wordpress/79/current-wordpress-page-name/)



It seems to do the job for getting page names.
Can&#039;t believe WP doesn&#039;t have this in the core.
Especially when some WP peeps start saying how it has caught up Drupal.

Hope that saves some other people the pain for having to id pages.</description>
		<content:encoded><![CDATA[<p>Hi, I found this example here in the comments:<br />
(<a href="http://www.arkinex.com/wordpress/79/current-wordpress-page-name/" rel="nofollow">http://www.arkinex.com/wordpress/79/current-wordpress-page-name/</a>)</p>
<p>It seems to do the job for getting page names.<br />
Can&#8217;t believe WP doesn&#8217;t have this in the core.<br />
Especially when some WP peeps start saying how it has caught up Drupal.</p>
<p>Hope that saves some other people the pain for having to id pages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan</title>
		<link>http://www.web-templates.nu/2008/09/02/get-id-by-page-name/comment-page-1/#comment-6036</link>
		<dc:creator>Ryan</dc:creator>
		<pubDate>Mon, 22 Feb 2010 10:51:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.web-templates.nu/?p=35#comment-6036</guid>
		<description>I was looking for a good 2 hours for a way to do this. Thanks so much!</description>
		<content:encoded><![CDATA[<p>I was looking for a good 2 hours for a way to do this. Thanks so much!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

