<?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: WordPress Post Slug and Page Slug Function</title>
	<atom:link href="http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/feed" rel="self" type="application/rss+xml" />
	<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function</link>
	<description></description>
	<lastBuildDate>Fri, 16 Jul 2010 18:34:19 -0500</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daggerhart</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-121</link>
		<dc:creator>Daggerhart</dc:creator>
		<pubDate>Fri, 26 Mar 2010 20:41:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-121</guid>
		<description>Here is a recursive version (for nested pages)  Along with a shortcode version for inside of posts.

/*
 * Slug Links suite of functions
 */
function the_slug($post_id)
{
		$post_data = get_post($post_id, ARRAY_A);
		
		// if it has a prent, get that slug too
		if($post_data[&#039;post_parent&#039;])
		{
				$output.= the_slug($post_data[&#039;post_parent&#039;]).&quot;/&quot;;
		}
		else
		{
				$output = &quot;/&quot;.$output;
		}
		$output .=  $post_data[&#039;post_name&#039;];
		
		return $output;
}

/*
 * Shortcode for slug function
 * ie. [s p=1]
 */
function the_slug_shortcode($atts)
{
		$short_array = shortcode_atts(array(&#039;p&#039; =&gt; &#039;&#039;), $atts);
		extract($short_array);

		return the_slug($p);
}
add_shortcode(&#039;s&#039;, &#039;the_slug_shortcode&#039;);</description>
		<content:encoded><![CDATA[<p>Here is a recursive version (for nested pages)  Along with a shortcode version for inside of posts.</p>
<p>/*<br />
 * Slug Links suite of functions<br />
 */<br />
function the_slug($post_id)<br />
{<br />
		$post_data = get_post($post_id, ARRAY_A);</p>
<p>		// if it has a prent, get that slug too<br />
		if($post_data['post_parent'])<br />
		{<br />
				$output.= the_slug($post_data['post_parent']).&#8221;/&#8221;;<br />
		}<br />
		else<br />
		{<br />
				$output = &#8220;/&#8221;.$output;<br />
		}<br />
		$output .=  $post_data['post_name'];</p>
<p>		return $output;<br />
}</p>
<p>/*<br />
 * Shortcode for slug function<br />
 * ie. [s p=1]<br />
 */<br />
function the_slug_shortcode($atts)<br />
{<br />
		$short_array = shortcode_atts(array(&#8217;p&#8217; =&gt; &#8221;), $atts);<br />
		extract($short_array);</p>
<p>		return the_slug($p);<br />
}<br />
add_shortcode(&#8217;s&#8217;, &#8216;the_slug_shortcode&#8217;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Weblap.ro</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-117</link>
		<dc:creator>Weblap.ro</dc:creator>
		<pubDate>Sat, 06 Mar 2010 11:23:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-117</guid>
		<description>function remove_accent($str)
{
	$a = array(&#039;À&#039;,&#039;Á&#039;,&#039;Â&#039;,&#039;Ã&#039;,&#039;Ä&#039;,&#039;Å&#039;,&#039;Æ&#039;,&#039;Ç&#039;,&#039;È&#039;,&#039;É&#039;,&#039;Ê&#039;,&#039;Ë&#039;,&#039;Ì&#039;,&#039;Í&#039;,&#039;Î&#039;,&#039;Ï&#039;,&#039;Ð&#039;,&#039;Ñ&#039;,&#039;Ò&#039;,&#039;Ó&#039;,&#039;Ô&#039;,&#039;Õ&#039;,&#039;Ö&#039;,&#039;Ø&#039;,&#039;Ù&#039;,&#039;Ú&#039;,&#039;Û&#039;,&#039;Ü&#039;,&#039;Ý&#039;,&#039;ß&#039;,&#039;à&#039;,&#039;á&#039;,&#039;â&#039;,&#039;ã&#039;,&#039;ä&#039;,&#039;å&#039;,&#039;æ&#039;,&#039;ç&#039;,&#039;è&#039;,&#039;é&#039;,&#039;ê&#039;,&#039;ë&#039;,&#039;ì&#039;,&#039;í&#039;,&#039;î&#039;,&#039;ï&#039;,&#039;ñ&#039;,&#039;ò&#039;,&#039;ó&#039;,&#039;ô&#039;,&#039;õ&#039;,&#039;ö&#039;,&#039;ø&#039;,&#039;ù&#039;,&#039;ú&#039;,&#039;û&#039;,&#039;ü&#039;,&#039;ý&#039;,&#039;ÿ&#039;,&#039;Ā&#039;,&#039;ā&#039;,&#039;Ă&#039;,&#039;ă&#039;,&#039;Ą&#039;,&#039;ą&#039;,&#039;Ć&#039;,&#039;ć&#039;,&#039;Ĉ&#039;,&#039;ĉ&#039;,&#039;Ċ&#039;,&#039;ċ&#039;,&#039;Č&#039;,&#039;č&#039;,&#039;Ď&#039;,&#039;ď&#039;,&#039;Đ&#039;,&#039;đ&#039;,&#039;Ē&#039;,&#039;ē&#039;,&#039;Ĕ&#039;,&#039;ĕ&#039;,&#039;Ė&#039;,&#039;ė&#039;,&#039;Ę&#039;,&#039;ę&#039;,&#039;Ě&#039;,&#039;ě&#039;,&#039;Ĝ&#039;,&#039;ĝ&#039;,&#039;Ğ&#039;,&#039;ğ&#039;,&#039;Ġ&#039;,&#039;ġ&#039;,&#039;Ģ&#039;,&#039;ģ&#039;,&#039;Ĥ&#039;,&#039;ĥ&#039;,&#039;Ħ&#039;,&#039;ħ&#039;,&#039;Ĩ&#039;,&#039;ĩ&#039;,&#039;Ī&#039;,&#039;ī&#039;,&#039;Ĭ&#039;,&#039;ĭ&#039;,&#039;Į&#039;,&#039;į&#039;,&#039;İ&#039;,&#039;ı&#039;,&#039;Ĳ&#039;,&#039;ĳ&#039;,&#039;Ĵ&#039;,&#039;ĵ&#039;,&#039;Ķ&#039;,&#039;ķ&#039;,&#039;Ĺ&#039;,&#039;ĺ&#039;,&#039;Ļ&#039;,&#039;ļ&#039;,&#039;Ľ&#039;,&#039;ľ&#039;,&#039;Ŀ&#039;,&#039;ŀ&#039;,&#039;Ł&#039;,&#039;ł&#039;,&#039;Ń&#039;,&#039;ń&#039;,&#039;Ņ&#039;,&#039;ņ&#039;,&#039;Ň&#039;,&#039;ň&#039;,&#039;ŉ&#039;,&#039;Ō&#039;,&#039;ō&#039;,&#039;Ŏ&#039;,&#039;ŏ&#039;,&#039;Ő&#039;,&#039;ő&#039;,&#039;Œ&#039;,&#039;œ&#039;,&#039;Ŕ&#039;,&#039;ŕ&#039;,&#039;Ŗ&#039;,&#039;ŗ&#039;,&#039;Ř&#039;,&#039;ř&#039;,&#039;Ś&#039;,&#039;ś&#039;,&#039;Ŝ&#039;,&#039;ŝ&#039;,&#039;Ş&#039;,&#039;ş&#039;,&#039;Š&#039;,&#039;š&#039;,&#039;Ţ&#039;,&#039;ţ&#039;,&#039;Ť&#039;,&#039;ť&#039;,&#039;Ŧ&#039;,&#039;ŧ&#039;,&#039;Ũ&#039;,&#039;ũ&#039;,&#039;Ū&#039;,&#039;ū&#039;,&#039;Ŭ&#039;,&#039;ŭ&#039;,&#039;Ů&#039;,&#039;ů&#039;,&#039;Ű&#039;,&#039;ű&#039;,&#039;Ų&#039;,&#039;ų&#039;,&#039;Ŵ&#039;,&#039;ŵ&#039;,&#039;Ŷ&#039;,&#039;ŷ&#039;,&#039;Ÿ&#039;,&#039;Ź&#039;,&#039;ź&#039;,&#039;Ż&#039;,&#039;ż&#039;,&#039;Ž&#039;,&#039;ž&#039;,&#039;ſ&#039;,&#039;ƒ&#039;,&#039;Ơ&#039;,&#039;ơ&#039;,&#039;Ư&#039;,&#039;ư&#039;,&#039;Ǎ&#039;,&#039;ǎ&#039;,&#039;Ǐ&#039;,&#039;ǐ&#039;,&#039;Ǒ&#039;,&#039;ǒ&#039;,&#039;Ǔ&#039;,&#039;ǔ&#039;,&#039;Ǖ&#039;,&#039;ǖ&#039;,&#039;Ǘ&#039;,&#039;ǘ&#039;,&#039;Ǚ&#039;,&#039;ǚ&#039;,&#039;Ǜ&#039;,&#039;ǜ&#039;,&#039;Ǻ&#039;,&#039;ǻ&#039;,&#039;Ǽ&#039;,&#039;ǽ&#039;,&#039;Ǿ&#039;,&#039;ǿ&#039;);
	$b = array(&#039;A&#039;,&#039;A&#039;,&#039;A&#039;,&#039;A&#039;,&#039;A&#039;,&#039;A&#039;,&#039;AE&#039;,&#039;C&#039;,&#039;E&#039;,&#039;E&#039;,&#039;E&#039;,&#039;E&#039;,&#039;I&#039;,&#039;I&#039;,&#039;I&#039;,&#039;I&#039;,&#039;D&#039;,&#039;N&#039;,&#039;O&#039;,&#039;O&#039;,&#039;O&#039;,&#039;O&#039;,&#039;O&#039;,&#039;O&#039;,&#039;U&#039;,&#039;U&#039;,&#039;U&#039;,&#039;U&#039;,&#039;Y&#039;,&#039;s&#039;,&#039;a&#039;,&#039;a&#039;,&#039;a&#039;,&#039;a&#039;,&#039;a&#039;,&#039;a&#039;,&#039;ae&#039;,&#039;c&#039;,&#039;e&#039;,&#039;e&#039;,&#039;e&#039;,&#039;e&#039;,&#039;i&#039;,&#039;i&#039;,&#039;i&#039;,&#039;i&#039;,&#039;n&#039;,&#039;o&#039;,&#039;o&#039;,&#039;o&#039;,&#039;o&#039;,&#039;o&#039;,&#039;o&#039;,&#039;u&#039;,&#039;u&#039;,&#039;u&#039;,&#039;u&#039;,&#039;y&#039;,&#039;y&#039;,&#039;A&#039;,&#039;a&#039;,&#039;A&#039;,&#039;a&#039;,&#039;A&#039;,&#039;a&#039;,&#039;C&#039;,&#039;c&#039;,&#039;C&#039;,&#039;c&#039;,&#039;C&#039;,&#039;c&#039;,&#039;C&#039;,&#039;c&#039;,&#039;D&#039;,&#039;d&#039;,&#039;D&#039;,&#039;d&#039;,&#039;E&#039;,&#039;e&#039;,&#039;E&#039;,&#039;e&#039;,&#039;E&#039;,&#039;e&#039;,&#039;E&#039;,&#039;e&#039;,&#039;E&#039;,&#039;e&#039;,&#039;G&#039;,&#039;g&#039;,&#039;G&#039;,&#039;g&#039;,&#039;G&#039;,&#039;g&#039;,&#039;G&#039;,&#039;g&#039;,&#039;H&#039;,&#039;h&#039;,&#039;H&#039;,&#039;h&#039;,&#039;I&#039;,&#039;i&#039;,&#039;I&#039;,&#039;i&#039;,&#039;I&#039;,&#039;i&#039;,&#039;I&#039;,&#039;i&#039;,&#039;I&#039;,&#039;i&#039;,&#039;IJ&#039;,&#039;ij&#039;,&#039;J&#039;,&#039;j&#039;,&#039;K&#039;,&#039;k&#039;,&#039;L&#039;,&#039;l&#039;,&#039;L&#039;,&#039;l&#039;,&#039;L&#039;,&#039;l&#039;,&#039;L&#039;,&#039;l&#039;,&#039;l&#039;,&#039;l&#039;,&#039;N&#039;,&#039;n&#039;,&#039;N&#039;,&#039;n&#039;,&#039;N&#039;,&#039;n&#039;,&#039;n&#039;,&#039;O&#039;,&#039;o&#039;,&#039;O&#039;,&#039;o&#039;,&#039;O&#039;,&#039;o&#039;,&#039;OE&#039;,&#039;oe&#039;,&#039;R&#039;,&#039;r&#039;,&#039;R&#039;,&#039;r&#039;,&#039;R&#039;,&#039;r&#039;,&#039;S&#039;,&#039;s&#039;,&#039;S&#039;,&#039;s&#039;,&#039;S&#039;,&#039;s&#039;,&#039;S&#039;,&#039;s&#039;,&#039;T&#039;,&#039;t&#039;,&#039;T&#039;,&#039;t&#039;,&#039;T&#039;,&#039;t&#039;,&#039;U&#039;,&#039;u&#039;,&#039;U&#039;,&#039;u&#039;,&#039;U&#039;,&#039;u&#039;,&#039;U&#039;,&#039;u&#039;,&#039;U&#039;,&#039;u&#039;,&#039;U&#039;,&#039;u&#039;,&#039;W&#039;,&#039;w&#039;,&#039;Y&#039;,&#039;y&#039;,&#039;Y&#039;,&#039;Z&#039;,&#039;z&#039;,&#039;Z&#039;,&#039;z&#039;,&#039;Z&#039;,&#039;z&#039;,&#039;s&#039;,&#039;f&#039;,&#039;O&#039;,&#039;o&#039;,&#039;U&#039;,&#039;u&#039;,&#039;A&#039;,&#039;a&#039;,&#039;I&#039;,&#039;i&#039;,&#039;O&#039;,&#039;o&#039;,&#039;U&#039;,&#039;u&#039;,&#039;U&#039;,&#039;u&#039;,&#039;U&#039;,&#039;u&#039;,&#039;U&#039;,&#039;u&#039;,&#039;U&#039;,&#039;u&#039;,&#039;A&#039;,&#039;a&#039;,&#039;AE&#039;,&#039;ae&#039;,&#039;O&#039;,&#039;o&#039;);
	return str_replace($a, $b, $str);
}

function post_slug($str)
{
	return strtolower(preg_replace(array(&#039;/[^a-zA-Z0-9 -]/&#039;, &#039;/[ -]+/&#039;, &#039;/^-&#124;-$/&#039;), array(&#039;&#039;, &#039;-&#039;, &#039;&#039;), remove_accent($str)));
}</description>
		<content:encoded><![CDATA[<p>function remove_accent($str)<br />
{<br />
	$a = array(&#8217;À&#8217;,'Á&#8217;,'Â&#8217;,'Ã&#8217;,'Ä&#8217;,'Å&#8217;,'Æ&#8217;,'Ç&#8217;,'È&#8217;,'É&#8217;,'Ê&#8217;,'Ë&#8217;,'Ì&#8217;,'Í&#8217;,'Î&#8217;,'Ï&#8217;,'Ð&#8217;,'Ñ&#8217;,'Ò&#8217;,'Ó&#8217;,'Ô&#8217;,'Õ&#8217;,'Ö&#8217;,'Ø&#8217;,'Ù&#8217;,'Ú&#8217;,'Û&#8217;,'Ü&#8217;,'Ý&#8217;,'ß&#8217;,'à&#8217;,'á&#8217;,'â&#8217;,'ã&#8217;,'ä&#8217;,'å&#8217;,'æ&#8217;,'ç&#8217;,'è&#8217;,'é&#8217;,'ê&#8217;,'ë&#8217;,'ì&#8217;,'í&#8217;,'î&#8217;,'ï&#8217;,'ñ&#8217;,'ò&#8217;,'ó&#8217;,'ô&#8217;,'õ&#8217;,'ö&#8217;,'ø&#8217;,'ù&#8217;,'ú&#8217;,'û&#8217;,'ü&#8217;,'ý&#8217;,'ÿ&#8217;,'Ā&#8217;,'ā&#8217;,'Ă&#8217;,'ă&#8217;,'Ą&#8217;,'ą&#8217;,'Ć&#8217;,'ć&#8217;,'Ĉ&#8217;,'ĉ&#8217;,'Ċ&#8217;,'ċ&#8217;,'Č&#8217;,'č&#8217;,'Ď&#8217;,'ď&#8217;,'Đ&#8217;,'đ&#8217;,'Ē&#8217;,'ē&#8217;,'Ĕ&#8217;,'ĕ&#8217;,'Ė&#8217;,'ė&#8217;,'Ę&#8217;,'ę&#8217;,'Ě&#8217;,'ě&#8217;,'Ĝ&#8217;,'ĝ&#8217;,'Ğ&#8217;,'ğ&#8217;,'Ġ&#8217;,'ġ&#8217;,'Ģ&#8217;,'ģ&#8217;,'Ĥ&#8217;,'ĥ&#8217;,'Ħ&#8217;,'ħ&#8217;,'Ĩ&#8217;,'ĩ&#8217;,'Ī&#8217;,'ī&#8217;,'Ĭ&#8217;,'ĭ&#8217;,'Į&#8217;,'į&#8217;,'İ&#8217;,'ı&#8217;,'Ĳ&#8217;,'ĳ&#8217;,'Ĵ&#8217;,'ĵ&#8217;,'Ķ&#8217;,'ķ&#8217;,'Ĺ&#8217;,'ĺ&#8217;,'Ļ&#8217;,'ļ&#8217;,'Ľ&#8217;,'ľ&#8217;,'Ŀ&#8217;,'ŀ&#8217;,'Ł&#8217;,'ł&#8217;,'Ń&#8217;,'ń&#8217;,'Ņ&#8217;,'ņ&#8217;,'Ň&#8217;,'ň&#8217;,'ŉ&#8217;,'Ō&#8217;,'ō&#8217;,'Ŏ&#8217;,'ŏ&#8217;,'Ő&#8217;,'ő&#8217;,'Œ&#8217;,'œ&#8217;,'Ŕ&#8217;,'ŕ&#8217;,'Ŗ&#8217;,'ŗ&#8217;,'Ř&#8217;,'ř&#8217;,'Ś&#8217;,'ś&#8217;,'Ŝ&#8217;,'ŝ&#8217;,'Ş&#8217;,'ş&#8217;,'Š&#8217;,'š&#8217;,'Ţ&#8217;,'ţ&#8217;,'Ť&#8217;,'ť&#8217;,'Ŧ&#8217;,'ŧ&#8217;,'Ũ&#8217;,'ũ&#8217;,'Ū&#8217;,'ū&#8217;,'Ŭ&#8217;,'ŭ&#8217;,'Ů&#8217;,'ů&#8217;,'Ű&#8217;,'ű&#8217;,'Ų&#8217;,'ų&#8217;,'Ŵ&#8217;,'ŵ&#8217;,'Ŷ&#8217;,'ŷ&#8217;,'Ÿ&#8217;,'Ź&#8217;,'ź&#8217;,'Ż&#8217;,'ż&#8217;,'Ž&#8217;,'ž&#8217;,'ſ&#8217;,'ƒ&#8217;,'Ơ&#8217;,'ơ&#8217;,'Ư&#8217;,'ư&#8217;,'Ǎ&#8217;,'ǎ&#8217;,'Ǐ&#8217;,'ǐ&#8217;,'Ǒ&#8217;,'ǒ&#8217;,'Ǔ&#8217;,'ǔ&#8217;,'Ǖ&#8217;,'ǖ&#8217;,'Ǘ&#8217;,'ǘ&#8217;,'Ǚ&#8217;,'ǚ&#8217;,'Ǜ&#8217;,'ǜ&#8217;,'Ǻ&#8217;,'ǻ&#8217;,'Ǽ&#8217;,'ǽ&#8217;,'Ǿ&#8217;,'ǿ&#8217;);<br />
	$b = array(&#8217;A',&#8217;A',&#8217;A',&#8217;A',&#8217;A',&#8217;A',&#8217;AE&#8217;,'C&#8217;,'E&#8217;,'E&#8217;,'E&#8217;,'E&#8217;,'I&#8217;,'I&#8217;,'I&#8217;,'I&#8217;,'D&#8217;,'N&#8217;,'O&#8217;,'O&#8217;,'O&#8217;,'O&#8217;,'O&#8217;,'O&#8217;,'U&#8217;,'U&#8217;,'U&#8217;,'U&#8217;,'Y&#8217;,&#8217;s&#8217;,'a&#8217;,'a&#8217;,'a&#8217;,'a&#8217;,'a&#8217;,'a&#8217;,'ae&#8217;,'c&#8217;,'e&#8217;,'e&#8217;,'e&#8217;,'e&#8217;,'i&#8217;,'i&#8217;,'i&#8217;,'i&#8217;,'n&#8217;,'o&#8217;,'o&#8217;,'o&#8217;,'o&#8217;,'o&#8217;,'o&#8217;,'u&#8217;,'u&#8217;,'u&#8217;,'u&#8217;,'y&#8217;,'y&#8217;,'A&#8217;,'a&#8217;,'A&#8217;,'a&#8217;,'A&#8217;,'a&#8217;,'C&#8217;,'c&#8217;,'C&#8217;,'c&#8217;,'C&#8217;,'c&#8217;,'C&#8217;,'c&#8217;,'D&#8217;,'d&#8217;,'D&#8217;,'d&#8217;,'E&#8217;,'e&#8217;,'E&#8217;,'e&#8217;,'E&#8217;,'e&#8217;,'E&#8217;,'e&#8217;,'E&#8217;,'e&#8217;,'G&#8217;,'g&#8217;,'G&#8217;,'g&#8217;,'G&#8217;,'g&#8217;,'G&#8217;,'g&#8217;,'H&#8217;,'h&#8217;,'H&#8217;,'h&#8217;,'I&#8217;,'i&#8217;,'I&#8217;,'i&#8217;,'I&#8217;,'i&#8217;,'I&#8217;,'i&#8217;,'I&#8217;,'i&#8217;,'IJ&#8217;,'ij&#8217;,'J&#8217;,'j&#8217;,'K&#8217;,'k&#8217;,'L&#8217;,'l&#8217;,'L&#8217;,'l&#8217;,'L&#8217;,'l&#8217;,'L&#8217;,'l&#8217;,'l&#8217;,'l&#8217;,'N&#8217;,'n&#8217;,'N&#8217;,'n&#8217;,'N&#8217;,'n&#8217;,'n&#8217;,'O&#8217;,'o&#8217;,'O&#8217;,'o&#8217;,'O&#8217;,'o&#8217;,'OE&#8217;,'oe&#8217;,'R&#8217;,'r&#8217;,'R&#8217;,'r&#8217;,'R&#8217;,'r&#8217;,'S&#8217;,&#8217;s&#8217;,'S&#8217;,&#8217;s&#8217;,'S&#8217;,&#8217;s&#8217;,'S&#8217;,&#8217;s&#8217;,'T&#8217;,'t&#8217;,'T&#8217;,'t&#8217;,'T&#8217;,'t&#8217;,'U&#8217;,'u&#8217;,'U&#8217;,'u&#8217;,'U&#8217;,'u&#8217;,'U&#8217;,'u&#8217;,'U&#8217;,'u&#8217;,'U&#8217;,'u&#8217;,'W&#8217;,'w&#8217;,'Y&#8217;,'y&#8217;,'Y&#8217;,'Z&#8217;,'z&#8217;,'Z&#8217;,'z&#8217;,'Z&#8217;,'z&#8217;,&#8217;s&#8217;,'f&#8217;,'O&#8217;,'o&#8217;,'U&#8217;,'u&#8217;,'A&#8217;,'a&#8217;,'I&#8217;,'i&#8217;,'O&#8217;,'o&#8217;,'U&#8217;,'u&#8217;,'U&#8217;,'u&#8217;,'U&#8217;,'u&#8217;,'U&#8217;,'u&#8217;,'U&#8217;,'u&#8217;,'A&#8217;,'a&#8217;,'AE&#8217;,'ae&#8217;,'O&#8217;,'o&#8217;);<br />
	return str_replace($a, $b, $str);<br />
}</p>
<p>function post_slug($str)<br />
{<br />
	return strtolower(preg_replace(array(&#8217;/[^a-zA-Z0-9 -]/&#8217;, &#8216;/[ -]+/&#8217;, &#8216;/^-|-$/&#8217;), array(&#8221;, &#8216;-&#8217;, &#8221;), remove_accent($str)));<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erin Sean</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-109</link>
		<dc:creator>Erin Sean</dc:creator>
		<pubDate>Sat, 09 Jan 2010 20:42:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-109</guid>
		<description>I wanted to add something that I found when using this function...

I needed to use the_slug() to dynamically display posts that were tagged the same as the slug name of the container page, and I needed to do it over the course of 4 loops on that single page.  So I wanted to use the_slug() in conjunction with query_post - my query_post looked something like this:

 &#039;News&#039;, 
  &#039;orderby&#039;=&gt;&#039;date&#039;,
  &#039;order&#039;=&gt;&#039;DESC&#039;,
  &#039;tag&#039;=&gt;the_slug(),
  &#039;posts_per_page&#039; =&gt; 2,
));

The problem was it would only work 1 time on page.  When I attempted to recycle the loop, the_slug() would not work again.

SO, I declared at the top of my template php file:

get_header();
$slugger=the_slug();

Then, for each of my 4 loops, my query_post looked like this:

 &#039;News&#039;, 
  &#039;orderby&#039;=&gt;&#039;date&#039;,
  &#039;order&#039;=&gt;&#039;DESC&#039;,
  &#039;tag&#039;=&gt;$slugger,
  &#039;posts_per_page&#039; =&gt; 2,
));

This time it worked like a charm! I was able to recycle that function for all 4 of my loops on page.</description>
		<content:encoded><![CDATA[<p>I wanted to add something that I found when using this function&#8230;</p>
<p>I needed to use the_slug() to dynamically display posts that were tagged the same as the slug name of the container page, and I needed to do it over the course of 4 loops on that single page.  So I wanted to use the_slug() in conjunction with query_post &#8211; my query_post looked something like this:</p>
<p> &#8216;News&#8217;,<br />
  &#8216;orderby&#8217;=&gt;&#8217;date&#8217;,<br />
  &#8216;order&#8217;=&gt;&#8217;DESC&#8217;,<br />
  &#8216;tag&#8217;=&gt;the_slug(),<br />
  &#8216;posts_per_page&#8217; =&gt; 2,<br />
));</p>
<p>The problem was it would only work 1 time on page.  When I attempted to recycle the loop, the_slug() would not work again.</p>
<p>SO, I declared at the top of my template php file:</p>
<p>get_header();<br />
$slugger=the_slug();</p>
<p>Then, for each of my 4 loops, my query_post looked like this:</p>
<p> &#8216;News&#8217;,<br />
  &#8216;orderby&#8217;=&gt;&#8217;date&#8217;,<br />
  &#8216;order&#8217;=&gt;&#8217;DESC&#8217;,<br />
  &#8216;tag&#8217;=&gt;$slugger,<br />
  &#8216;posts_per_page&#8217; =&gt; 2,<br />
));</p>
<p>This time it worked like a charm! I was able to recycle that function for all 4 of my loops on page.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinusha</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-107</link>
		<dc:creator>Dinusha</dc:creator>
		<pubDate>Thu, 17 Dec 2009 14:11:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-107</guid>
		<description>@ John, Thanks for the comments John. I&#039;m glad the code helped you.</description>
		<content:encoded><![CDATA[<p>@ John, Thanks for the comments John. I&#8217;m glad the code helped you.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-106</link>
		<dc:creator>John</dc:creator>
		<pubDate>Thu, 17 Dec 2009 10:14:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-106</guid>
		<description>Just what I was after. I want to use it to call a specific function file depending on the page landed on. That way I can maintain my functions easier and the main file doesn&#039;t get too big. I have all general functions in the functions.php and then several other functions file named after the relevant pages. Such as registration_fncs.php

Your code has really helped me getting this working. Thanks for your efforts. ;-)</description>
		<content:encoded><![CDATA[<p>Just what I was after. I want to use it to call a specific function file depending on the page landed on. That way I can maintain my functions easier and the main file doesn&#8217;t get too big. I have all general functions in the functions.php and then several other functions file named after the relevant pages. Such as registration_fncs.php</p>
<p>Your code has really helped me getting this working. Thanks for your efforts. <img src='http://www.insitewebsitedesign.com/insitewebsitedesign/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joseph</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-87</link>
		<dc:creator>joseph</dc:creator>
		<pubDate>Wed, 01 Jul 2009 11:44:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-87</guid>
		<description>Thanks... just what I was looking for. Surprising that WP doesn&#039;t have this built in.</description>
		<content:encoded><![CDATA[<p>Thanks&#8230; just what I was looking for. Surprising that WP doesn&#8217;t have this built in.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dinusha</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-86</link>
		<dc:creator>Dinusha</dc:creator>
		<pubDate>Tue, 30 Jun 2009 03:22:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-86</guid>
		<description>I&#039;m glad you found the tip helpful. Thanks.</description>
		<content:encoded><![CDATA[<p>I&#8217;m glad you found the tip helpful. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Leo Plaw</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-85</link>
		<dc:creator>Leo Plaw</dc:creator>
		<pubDate>Tue, 23 Jun 2009 21:09:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-85</guid>
		<description>Thanks for the tip. I&#039;ll be using it for element IDs.</description>
		<content:encoded><![CDATA[<p>Thanks for the tip. I&#8217;ll be using it for element IDs.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: BuyBedding</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-62</link>
		<dc:creator>BuyBedding</dc:creator>
		<pubDate>Wed, 20 May 2009 10:36:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-62</guid>
		<description>Great article! I’m loving your website;</description>
		<content:encoded><![CDATA[<p>Great article! I’m loving your website;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: churchill car insurance</title>
		<link>http://www.insitewebsitedesign.com/wordpress-post-slug-and-page-slug-function/comment-page-1#comment-41</link>
		<dc:creator>churchill car insurance</dc:creator>
		<pubDate>Thu, 14 May 2009 05:57:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.insitewebsitedesign.com/?p=612#comment-41</guid>
		<description>Great article! I’m loving your website;</description>
		<content:encoded><![CDATA[<p>Great article! I’m loving your website;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
