<?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>Robb Clarke - Fredericton Web and Print Designer &#187; CSS</title>
	<atom:link href="http://robbclarke.com/tag/css/feed/" rel="self" type="application/rss+xml" />
	<link>http://robbclarke.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 14 Aug 2010 12:49:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to Add &#8220;Like&#8221; and &#8220;Tweet&#8221; Buttons To WordPress Blog Posts</title>
		<link>http://robbclarke.com/coding-tricks/how-to-add-like-and-tweet-buttons-to-wordpress-blog-posts/</link>
		<comments>http://robbclarke.com/coding-tricks/how-to-add-like-and-tweet-buttons-to-wordpress-blog-posts/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 00:51:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tricks]]></category>
		<category><![CDATA[Codex]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Fredericton]]></category>
		<category><![CDATA[Fredericton Web Design]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Like]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[robbclarke.com]]></category>
		<category><![CDATA[Tweet]]></category>
		<category><![CDATA[Twitter]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Codex]]></category>

		<guid isPermaLink="false">http://robbclarke.com/?p=649</guid>
		<description><![CDATA[Yesterday I added the new Tweet button provided by Twitter and the new Like button provided by Facebook to my blog posts (seen above, click them to take the for a test drive). They&#8217;re quick and easy ways for readers to share posts with other readers and they even include some nifty little counters too. [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I added the new Tweet button provided by Twitter and the new Like button provided by Facebook to my blog posts <em>(seen above, click them to take the for a test drive)</em>. They&#8217;re quick and easy ways for readers to share posts with other readers and they even include some nifty little counters too. Oooh fancy!</p>
<p>Combining these buttons with the WordPress codex is pretty easy. Insert a couple snippets of code and you can easily add the URL and post/page title dynamically to the &#8220;Tweets&#8221; and &#8220;Likes&#8221;.</p>
<p>The codes from the WordPress codex that we&#8217;re going to use are:</p>
<div style="margin: 0 0 15px 0;">
<pre class="php">
<span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span><span class="htmlText"> the_permalink</span><span class="phpOperator">(</span><span class="phpOperator">)</span> <span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span><span class="htmlText"> and </span><span class="phpScriptTag"><span class="phpOperator">&lt;</span><span class="phpOperator">?</span>php</span><span class="htmlText"> the_title</span><span class="phpOperator">(</span><span class="phpOperator">)</span><span class="phpText">;</span> <span class="phpScriptTag"><span class="phpOperator">?</span><span class="phpOperator">&gt;</span></span>
</pre>
</div>
<p>Two lines of code and you&#8217;re all set up. Copy and paste the code below, style as needed to position the buttons how you see fit. For the Twitter Tweet button, don&#8217;t forget to replace my username with yours.</p>
<h3>Facebook Like Button</h3>
<div style="margin: 0 0 15px 0;">
<pre class="html">
<span class="htmlOtherTag">&lt;iframe src=<span class="htmlAttributeValue">&quot;http://www.facebook.com/plugins/like.php?href=&lt;?php the_permalink() ?&gt;</span><span class="htmlSpecialChar">&amp;amp;</span>layout=button_count<span class="htmlSpecialChar">&amp;amp;</span>show_faces=false<span class="htmlSpecialChar">&amp;amp;</span>width=100<span class="htmlSpecialChar">&amp;amp;</span>action=like<span class="htmlSpecialChar">&amp;amp;</span>font=arial<span class="htmlSpecialChar">&amp;amp;</span>colorscheme=light<span class="htmlSpecialChar">&amp;amp;</span>height=21&quot;</span> scrolling=<span class="htmlAttributeValue">&quot;no&quot;</span> frameborder=<span class="htmlAttributeValue">&quot;0&quot;</span> style=<span class="htmlAttributeValue">&quot;<span class="cssProperty">border</span><span class="cssRest">:</span><span class="cssValue">none</span><span class="cssRest">;</span> <span class="cssProperty">overflow</span><span class="cssRest">:</span><span class="cssValue">hidden</span><span class="cssRest">;</span> <span class="cssProperty">width</span><span class="cssRest">:</span><span class="cssValue">100px</span><span class="cssRest">;</span> <span class="cssProperty">height</span><span class="cssRest">:</span><span class="cssValue">21px</span><span class="cssRest">;</span>&quot;</span> allowTransparency=<span class="htmlAttributeValue">&quot;true&quot;</span>&gt;<span class="htmlOtherTag">&lt;/iframe&gt;</span>
</pre>
</div>
<h3>Twitter Tweet Button</h3>
<div style="margin: 0 0 15px 0;">
<pre class="html">
<span class="htmlAnchorTag">&lt;a href=<span class="htmlAttributeValue">&quot;http://twitter.com/share&quot;</span> class=<span class="htmlAttributeValue">&quot;twitter-share-button&quot;</span> data-text=<span class="htmlAttributeValue">&quot;<span class="htmlOtherTag">&lt;?php the_title(); ?&gt;</span></span>&quot;</span> data-count=<span class="htmlAttributeValue">&quot;horizontal&quot;</span> data-via=<span class="htmlAttributeValue">&quot;robbclarke&quot;</span>&gt;Tweet<span class="htmlAnchorTag">&lt;/a&gt;</span><span class="htmlScriptTag">&lt;script type=<span class="htmlAttributeValue">&quot;text/javascript&quot;</span> src=<span class="htmlAttributeValue">&quot;http://platform.twitter.com/widgets.js&quot;</span>&gt;</span><span class="htmlScriptTag">&lt;/script&gt;</span>
</pre>
</div>
<p>Did you find this useful? Wouldn&#8217;t hurt to share it with others would it?</p>
]]></content:encoded>
			<wfw:commentRss>http://robbclarke.com/coding-tricks/how-to-add-like-and-tweet-buttons-to-wordpress-blog-posts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>River Valley Arts Alliance Site Launch</title>
		<link>http://robbclarke.com/site-builds/river-valley-arts-alliance-site-launch/</link>
		<comments>http://robbclarke.com/site-builds/river-valley-arts-alliance-site-launch/#comments</comments>
		<pubDate>Sun, 16 May 2010 15:25:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Site Builds]]></category>
		<category><![CDATA[Content Management System]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dooryard Arts Festival]]></category>
		<category><![CDATA[Fredericton]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[RiVA]]></category>
		<category><![CDATA[River Valley Arts Alliance]]></category>
		<category><![CDATA[Search Engine Optimization]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Woodstock]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://robbclarke.com/?p=437</guid>
		<description><![CDATA[<a rel="attachment wp-att-436" href="http://robbclarke.com/?attachment_id=436"><img class="alignnone size-full wp-image-436" title="riva" src="http://robbclarke.com/wp-content/uploads/2010/05/riva.jpg" alt="riva" width="600" height="200" /></a>]]></description>
			<content:encoded><![CDATA[<p><a href="/site-builds/river-valley-arts-alliance-site-launch/"><img class="alignnone size-full wp-image-436" title="riva" src="http://robbclarke.com/wp-content/uploads/2010/05/riva.jpg" alt="riva" width="600" height="200" /></a></p>
<p>This week I&#8217;m proud to announce the launch of the new <a title="River Valley Arts Alliance" href="http://www.rivervalleyarts.net" target="_blank">River Valley Arts Alliance website</a>. The website is build on the WordPress content management system, letting the client update the website at their leisure.</p>
<p>The site features:</p>
<ul>
<li>an events calendar</li>
<li>photo slideshow</li>
<li>photo gallery</li>
<li>member application forms</li>
<li>donation forms</li>
<li>an artist database</li>
<li>a microsite for their annual Dooryard Arts Festival</li>
</ul>
<p>The website is going to be a great resources for keeping up to date with RiVA and the arts community in and around the Saint John River Valley. Be sure to check back frequently as we near the festival dates for Dooryard as more events and festivities are announced.</p>
]]></content:encoded>
			<wfw:commentRss>http://robbclarke.com/site-builds/river-valley-arts-alliance-site-launch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Two Really Useful Tips to Keep Your CSS Clean</title>
		<link>http://robbclarke.com/coding-tricks/two-really-useful-tips-to-keep-your-css-clean/</link>
		<comments>http://robbclarke.com/coding-tricks/two-really-useful-tips-to-keep-your-css-clean/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 17:02:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tricks]]></category>
		<category><![CDATA[Clean Code]]></category>
		<category><![CDATA[Coding Styles]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[margin]]></category>
		<category><![CDATA[Markup]]></category>
		<category><![CDATA[Shorthand]]></category>

		<guid isPermaLink="false">http://clarkegraphics.com/?p=142</guid>
		<description><![CDATA[One common question amongst my students when it comes to their CSS is &#8220;How do you keep your code clean?&#8221; While there are numerous ways to keep your code clean and very readable, there are two sure fire ways to keep it nice and clean and readable. Use Shorthand Get rid of any unnecessary code [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://clarkegraphics.com/2009/09/two-really-useful-tips-to-keep-your-css-clean/"><img class="alignright size-full wp-image-206" title="cleanscss" src="http://clarkegraphics.com/wp-content/uploads/2009/09/cleanss.jpg" alt="cleanscss" width="600" height="200" /></a></p>
<p>One common question amongst my students when it comes to their CSS is &#8220;How do you keep your code clean?&#8221; While there are numerous ways to keep your code clean and very readable, there are two sure fire ways to keep it nice and clean and readable.</p>
<h4>Use Shorthand</h4>
<p>Get rid of any unnecessary code that is cluttering up your code. Do you use margin-top, border-top, padding-top etc. on a daily basis? If so, lose it.</p>
<p><strong>Incorrect</strong></p>
<pre class="css"><span class="cssSelector">p {</span>
<span class="cssProperty">margin-top</span><span class="cssRest">:</span><span class="cssValue"> 10px</span><span class="cssRest">;</span>
<span class="cssProperty">margin-right</span><span class="cssRest">:</span><span class="cssValue"> 5px</span><span class="cssRest">;</span>
<span class="cssProperty">margin-bottom</span><span class="cssRest">:</span><span class="cssValue"> 4px</span><span class="cssRest">;</span>
<span class="cssProperty">margin-left</span><span class="cssRest">:</span><span class="cssValue"> 5px</span><span class="cssRest">;</span> <span class="cssSelector">}</span> </pre>
<p>You&#8217;ve got five lines of code there when you really only need one that will do the same thing.</p>
<p><strong>Correct</strong></p>
<pre class="css"><span class="cssSelector">p {</span><span class="cssProperty">margin</span><span class="cssRest">:</span><span class="cssValue"> 10px 5px 4px 5px</span><span class="cssRest">;</span> <span class="cssSelector">}</span></pre>
<p>You&#8217;re able to define information for each of the four sides (top, right, bottom, left) in a single line. The end result is something that&#8217;s much easier to read and takes up far less space. Each of the numbers represents the four sides (in this order); top, right, bottom, left.</p>
<p>Here are a few other examples of ways to shorten things up&#8230;</p>
<pre class="css"><span class="cssComment">/** 3 Values - Middle defines right and left **/</span>
<span class="cssSelector">p {</span><span class="cssProperty">margin</span><span class="cssRest">:</span><span class="cssValue"> 10px 5px 4px</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssComment">/** 2 Values - 1st defines top and bottom, 2nd defines right and left. **/</span>
<span class="cssSelector">p {</span><span class="cssProperty">margin</span><span class="cssRest">:</span><span class="cssValue"> 10px 5px</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssComment">/** 1 Value - Defines all four sides **/</span>
<span class="cssSelector">p {</span><span class="cssProperty">margin</span><span class="cssRest">:</span><span class="cssValue"> 10px</span><span class="cssRest">;</span> <span class="cssSelector">}</span></pre>
<h4>Document Your Code</h4>
<p>The second really really easy way to keep your code nice and clean is to document everything. This will not only help you for when you&#8217;re writing it initially but it will also save you lots of time 8 months down the road when the client asks you for changes and you have to go sifting through your code to find the bit that needs changing.</p>
<p>The easiest way to do this is to use comments.</p>
<pre class="css"><span class="cssComment">/** HEADER **/</span>
<span class="cssSelector">#header {</span>
<span class="cssProperty">width</span><span class="cssRest">:</span><span class="cssValue"> 800px</span><span class="cssRest">;</span>
<span class="cssProperty">height</span><span class="cssRest">:</span><span class="cssValue"> 200px</span><span class="cssRest">;</span>
<span class="cssProperty">float</span><span class="cssRest">:</span><span class="cssValue"> left</span><span class="cssRest">;</span>
<span class="cssProperty">background</span><span class="cssRest">:</span><span class="cssValue"> url(../images/header.jpg)</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssComment">/** NAVIGATION **/</span>
<span class="cssSelector">ul#nav {</span>
<span class="cssProperty">width</span><span class="cssRest">:</span><span class="cssValue"> 800px</span><span class="cssRest">;</span>
<span class="cssProperty">height</span><span class="cssRest">:</span><span class="cssValue"> 50px</span><span class="cssRest">;</span>
<span class="cssProperty">float</span><span class="cssRest">:</span><span class="cssValue"> left</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">ul#nav li {</span>
<span class="cssProperty">float</span><span class="cssRest">:</span><span class="cssValue"> left</span><span class="cssRest">;</span>
<span class="cssProperty">height</span><span class="cssRest">:</span><span class="cssValue"> 50px</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
</pre>
<p>For a team of designers and coders, it&#8217;s important to talk to each other regularly so that the markup is created in a consistent way, and also to create site standards. You don&#8217;t want to have 3 or 4 different coding styles on the same document, it will just get confusing. For example, if someone comes up with way to markup a tab interface for the site, documentation will keep others from duplicating that effort, preventing unnecessary code in the HTML and CSS.</p>
<p>Documentation, including markup guides and style sheet guides, is not just for group efforts — they are just as important for a one-man design team. After all, a year after working on other things, revisiting one of your own projects can feel quite foreign. Trust me, I&#8217;ve been there before. Your future self might appreciate reminder of how your CSS is supposed to work, or what pages already have a treatment for a secondary action form button, and it will save you or someone else from appending redundant and unnecessary rules to your CSS. Without proper documentation you can and will spend lots of unnecessary time sifting through code and comparing different parts so it&#8217;s always best to document your code to the best of your abilities. Your comments don&#8217;t have to be kept short either, if you need to have a few sentences describing what does what, don&#8217;t be afraid to do it.</p>
<p>I hope this helps a little bit the next time you sit down to write some code.</p>
]]></content:encoded>
			<wfw:commentRss>http://robbclarke.com/coding-tricks/two-really-useful-tips-to-keep-your-css-clean/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How To: Add a Dotted Underline to Your Links</title>
		<link>http://robbclarke.com/coding-tricks/how-to-add-a-dotted-underline-to-your-links/</link>
		<comments>http://robbclarke.com/coding-tricks/how-to-add-a-dotted-underline-to-your-links/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 18:34:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tricks]]></category>
		<category><![CDATA[border]]></category>
		<category><![CDATA[Coding]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[dotted]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Underline]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://clarkegraphics.com/?p=120</guid>
		<description><![CDATA[Sick and tired of boring old underlines to show that a bit of text is a link? Here&#8217;s a really quick bit of CSS to show a dotted underline on your links (like this). It&#8217;s so easy to do this that it hurts. We&#8217;re just swapping the underline for a border. Dotted Underline on Hover [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://clarkegraphics.com/2009/09/how-to-add-a-dotted-underline-to-your-links/"><img class="alignright size-full wp-image-213" title="dotted" src="http://clarkegraphics.com/wp-content/uploads/2009/09/dotted.jpg" alt="dotted" width="600" height="200" /></a></p>
<p>Sick and tired of boring old underlines to show that a bit of text is a link? Here&#8217;s a really quick bit of CSS to show a dotted underline on your links (like this).</p>
<p><img class="alignnone size-full wp-image-121" title="dotted-url" src="http://clarkegraphics.com/wp-content/uploads/2009/09/dotted-url.jpg" alt="dotted-url" width="156" height="22" /></p>
<p>It&#8217;s so easy to do this that it hurts. We&#8217;re just swapping the underline for a border.</p>
<h4>Dotted Underline on Hover Only</h4>
<pre class="css"><span class="cssSelector">a:link, a:visited {</span>
<span class="cssProperty">text-decoration</span><span class="cssRest">:</span><span class="cssValue"> none</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">a:hover {</span>
<span class="cssProperty">border-bottom</span><span class="cssRest">:</span><span class="cssValue"> 1px dotted #000</span><span class="cssRest">;</span> <span class="cssSelector">}</span></pre>
<p>What this does is remove the underline from the text so that when it&#8217;s not being hovered over there&#8217;s no underline. On hover, the dotted border appears.</p>
<h4>Dotted Underline At All Times</h4>
<pre class="css"><span class="cssSelector">a:link, a:visited {</span>
<span class="cssProperty">text-decoration</span><span class="cssRest">:</span><span class="cssValue"> none</span><span class="cssRest">;</span>
<span class="cssProperty">border-bottom</span><span class="cssRest">:</span><span class="cssValue"> 1px dotted #000</span><span class="cssRest">;</span> <span class="cssSelector">}</span></pre>
<p>This removes the underline and replaces it with the dotted border at all times.</p>
<p>Obviously a dotted border isn&#8217;t the only option out there. Play around with the other options and see what looks good and fits your site the best. Here&#8217;s the list of all of the types of borders that you can do.</p>
<h4>CSS Border Types</h4>
<pre class="css">
<span class="cssSelector">p.solid {</span><span class="cssProperty">border-style</span><span class="cssRest">:</span><span class="cssValue"> solid</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">p.double {</span><span class="cssProperty">border-style</span><span class="cssRest">:</span><span class="cssValue"> double</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">p.groove {</span><span class="cssProperty">border-style</span><span class="cssRest">:</span><span class="cssValue"> groove</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">p.dotted {</span><span class="cssProperty">border-style</span><span class="cssRest">:</span><span class="cssValue"> dotted</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">p.dashed {</span><span class="cssProperty">border-style</span><span class="cssRest">:</span><span class="cssValue"> dashed</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">p.inset {</span><span class="cssProperty">border-style</span><span class="cssRest">:</span><span class="cssValue"> inset</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">p.outset {</span><span class="cssProperty">border-style</span><span class="cssRest">:</span><span class="cssValue"> outset</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">p.ridge {</span><span class="cssProperty">border-style</span><span class="cssRest">:</span><span class="cssValue"> ridge</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
<span class="cssSelector">p.hidden {</span><span class="cssProperty">border-style</span><span class="cssRest">:</span><span class="cssValue"> hidden</span><span class="cssRest">;</span> <span class="cssSelector">}</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://robbclarke.com/coding-tricks/how-to-add-a-dotted-underline-to-your-links/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Different Ways to Generate URLs in WordPress</title>
		<link>http://robbclarke.com/coding-tricks/different-ways-to-generate-urls-in-wordpress/</link>
		<comments>http://robbclarke.com/coding-tricks/different-ways-to-generate-urls-in-wordpress/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 22:37:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Coding Tricks]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Dynamic URL]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[URL Generator]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://clarkegraphics.com/?p=81</guid>
		<description><![CDATA[I&#8217;m big on WordPress, in fact, I&#8217;m using it for this site and most of the other sites that I&#8217;ve coded. Recently (when working on this blog) I decided that I wanted to generate the URL of the current page so that I could submit that specific page to social media sites, not just the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://clarkegraphics.com/2009/08/different-ways-to-generate-urls-in-wordpress/"><img class="alignright size-full wp-image-88" title="robbclarke-wordpress" src="http://clarkegraphics.com/wp-content/uploads/2009/08/wordpress.jpg" alt="robbclarke-wordpress" width="600" height="200" /></a><br />
I&#8217;m big on WordPress, in fact, I&#8217;m using it for this site and most of the other sites that I&#8217;ve coded. Recently (when working on this blog) I decided that I wanted to generate the URL of the current page so that I could submit that specific page to social media sites, not just the root URL. I search everywhere but couldn&#8217;t find the solution that I was looking for and then it hit me.</p>
<p>If you want to dynamically generate the URL of the page/post that you are currently viewing then all you need to enter is:</p>
<pre class="php"></pre>
<p>This code generates and displays the current URL, which is great for submitting articles to Digg, Facebook, Twitter etc. etc.</p>
<p>What a big sigh of relief it was when I found that. The funny thing is that it&#8217;s been staring me in the face all along.</p>
<h4>Various Codes to Generate Different URLs in WordPress</h4>
<p>Below is a list of a number of variables used to generate various URLs using WordPress. The variable is on the left and the result is on the right.</p>
<pre class="php">admin_email <span class="phpOperator">=</span> admin@example
atom_url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/feed/atom
</span>charset <span class="phpOperator">=</span> UTF-<span class="phpNumber">8</span>
comments_atom_url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/comments/feed/atom
</span>comments_rss2_url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/comments/feed
</span>description <span class="phpOperator">=</span> Just another WordPress blog
home <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home
</span>html_type <span class="phpOperator">=</span> text/html
language <span class="phpOperator">=</span> en-US
name <span class="phpOperator">=</span> Testpilot
pingback_url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/wp/xmlrpc<span class="phpOperator">.</span>php
</span>rdf_url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/feed/rdf
</span>rss2_url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/feed
</span>rss_url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/feed/rss
</span>siteurl <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home
</span>stylesheet_directory <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/wp/wp-content/themes/largo
</span>stylesheet_url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/wp/wp-content/themes/largo/style.css
</span>template_directory <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/wp/wp-content/themes/largo
</span>template_url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home/wp/wp-content/themes/largo
</span>text_direction <span class="phpOperator">=</span> ltr
url <span class="phpOperator">=</span> http<span class="phpOperator">:</span><span class="phpComment">//example/home
</span>version <span class="phpOperator">=</span> <span class="phpNumber">2</span><span class="phpOperator">.</span><span class="phpNumber">7</span>
wpurl <span class="phpOperator">=</span> http<span class="phpOperator">:</span>//example/home/wp</pre>
<p>You can easily display this information by substituting the variable in the following code for the desired URL:</p>
<pre class="php"></pre>
<p>Did that help? Share your thoughts below!</p>
]]></content:encoded>
			<wfw:commentRss>http://robbclarke.com/coding-tricks/different-ways-to-generate-urls-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
