<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: How do I fetch the slug, sans domain, in WordPress/PHP?</title>
	<link>http://ask.metafilter.com/43888/How-do-I-fetch-the-slug-sans-domain-in-WordPressPHP/</link>
	<description>Comments on Ask MetaFilter post How do I fetch the slug, sans domain, in WordPress/PHP?</description>
	<pubDate>Mon, 07 Aug 2006 20:39:36 -0800</pubDate>
	<lastBuildDate>Mon, 07 Aug 2006 20:39:36 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: How do I fetch the slug, sans domain, in WordPress/PHP?</title>
		<link>http://ask.metafilter.com/43888/How-do-I-fetch-the-slug-sans-domain-in-WordPressPHP</link>	
		<description>Learning my way around WordPress.  How do I fetch the slug text, sans domain, in WordPress/PHP? &lt;br /&gt;&lt;br /&gt; Neither the docs nor Google seem to have an answer for me.&lt;br&gt;
&lt;br&gt;
I don&apos;t, for example, want &lt;a href=&quot;http://codex.wordpress.org/Template_Tags/the_permalink&quot;&gt;the_permalink()&lt;/a&gt;, which returns a fully-qualified URL.  I want &lt;i&gt;just&lt;/i&gt; the slug text, as bolded below:&lt;br&gt;
&lt;br&gt;
http://www.domainypants.com/06/07/31/&lt;b&gt;this-is-the-slug&lt;/b&gt;/&lt;br&gt;
&lt;br&gt;
I have enough programming acumen to figure out how to strip this out of the larger permalink if necessary, but I&apos;d like to know, definitively, if I need to or if WordPress actually makes this available out of the box.</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2006:site.43888</guid>
		<pubDate>Mon, 07 Aug 2006 20:26:42 -0800</pubDate>
		<dc:creator>cortex</dc:creator>
		
			<category>wordpress</category>
		
			<category>php</category>
		
			<category>slug</category>
		
			<category>permalink</category>
		
			<category>blog</category>
		
	</item> <item>
		<title>By: misterbrandt</title>
		<link>http://ask.metafilter.com/43888/How-do-I-fetch-the-slug-sans-domain-in-WordPressPHP#673408</link>	
		<description>Does &lt;a href=&quot;http://wordpress.org/support/topic/32894&quot;&gt;this&lt;/a&gt; work?&lt;br&gt;
&lt;code&gt;$post-&amp;gt;post_name&lt;/code&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.43888-673408</guid>
		<pubDate>Mon, 07 Aug 2006 20:39:36 -0800</pubDate>
		<dc:creator>misterbrandt</dc:creator>
	</item><item>
		<title>By: cortex</title>
		<link>http://ask.metafilter.com/43888/How-do-I-fetch-the-slug-sans-domain-in-WordPressPHP#673418</link>	
		<description>!&lt;br&gt;
&lt;br&gt;
&lt;small&gt;tests it&lt;/small&gt;&lt;br&gt;
&lt;br&gt;
Hugs!  I swear I tried that already, but I was clearly wrong.&lt;br&gt;
&lt;br&gt;
&lt;small&gt;You&apos;re not a gweeper, are you?&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.43888-673418</guid>
		<pubDate>Mon, 07 Aug 2006 20:47:23 -0800</pubDate>
		<dc:creator>cortex</dc:creator>
	</item><item>
		<title>By: misterbrandt</title>
		<link>http://ask.metafilter.com/43888/How-do-I-fetch-the-slug-sans-domain-in-WordPressPHP#673424</link>	
		<description>&lt;a href=&quot;http://wordpress.org/support/topic/62326&quot;&gt;Here is another post&lt;/a&gt; that seems to confirm the &lt;code&gt;$post-&amp;gt;post_name&lt;/code&gt; is what you are looking for:&lt;br&gt;
&lt;pre&gt;&lt;br&gt;
function get_the_slug() {&lt;br&gt;
	global $post;&lt;br&gt;
	if ( is_single() || is_page() ) {&lt;br&gt;
		return $post-&amp;gt;post_name;&lt;br&gt;
	} else {&lt;br&gt;
		return &quot;&quot;;&lt;br&gt;
	}&lt;br&gt;
}&lt;br&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
on preview, cool. glad it actually works &lt;em&gt;for reals&lt;/em&gt;. &lt;br&gt;
and wtf is a gweeper?</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.43888-673424</guid>
		<pubDate>Mon, 07 Aug 2006 20:50:02 -0800</pubDate>
		<dc:creator>misterbrandt</dc:creator>
	</item><item>
		<title>By: cortex</title>
		<link>http://ask.metafilter.com/43888/How-do-I-fetch-the-slug-sans-domain-in-WordPressPHP#673426</link>	
		<description>Something that a different Josh Brandt would self-identify as.  Mystery resolved!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.43888-673426</guid>
		<pubDate>Mon, 07 Aug 2006 20:57:17 -0800</pubDate>
		<dc:creator>cortex</dc:creator>
	</item><item>
		<title>By: misterbrandt</title>
		<link>http://ask.metafilter.com/43888/How-do-I-fetch-the-slug-sans-domain-in-WordPressPHP#673433</link>	
		<description>ah. well, &lt;strong&gt;josh power&lt;/strong&gt;, and all that!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2006:site.43888-673433</guid>
		<pubDate>Mon, 07 Aug 2006 21:07:23 -0800</pubDate>
		<dc:creator>misterbrandt</dc:creator>
	</item>
	</channel>
</rss>
