<?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>willoller.com &#187; Wordpress</title>
	<atom:link href="http://www.willoller.com/category/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.willoller.com</link>
	<description>Learning to match the beat of the Old World man.</description>
	<lastBuildDate>Thu, 02 Feb 2012 23:34:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Add page slug to class list using wp_list_pages</title>
		<link>http://www.willoller.com/add-page-slug-to-class-list-using-wp_list_pages/</link>
		<comments>http://www.willoller.com/add-page-slug-to-class-list-using-wp_list_pages/#comments</comments>
		<pubDate>Tue, 07 Dec 2010 00:00:43 +0000</pubDate>
		<dc:creator>will</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.willoller.com/?p=499</guid>
		<description><![CDATA[function menu_css_class($css_class, $page){ $css_class[] = "page-slug-" . $page-&#62;post_name; return $css_class; } add_filter("page_css_class", "menu_css_class", 10, 2);]]></description>
			<content:encoded><![CDATA[<code><pre>
function menu_css_class($css_class, $page){
    $css_class[] = "page-slug-" . $page-&gt;post_name;
    return $css_class;
}
add_filter("page_css_class", "menu_css_class", 10, 2);
</pre></code>

 ]]></content:encoded>
			<wfw:commentRss>http://www.willoller.com/add-page-slug-to-class-list-using-wp_list_pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Limiting title and excerpt length with WordPress</title>
		<link>http://www.willoller.com/limiting-title-and-excerpt-length-with-wordpress/</link>
		<comments>http://www.willoller.com/limiting-title-and-excerpt-length-with-wordpress/#comments</comments>
		<pubDate>Sat, 14 Apr 2007 00:55:42 +0000</pubDate>
		<dc:creator>will</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php programming]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.willoller.com/limiting-title-and-excerpt-length-with-wordpress/</guid>
		<description><![CDATA[Sometimes clients have very specific requirements. Sometimes they want autometic controls on simple things they have total control over anyway. I digress. In this case, blog titles needed to be of any length, but have their lengths truncated under certain circumstances. Furthermore, excerpts need to be able to be the default length (50 words), but [...]]]></description>
			<content:encoded><![CDATA[	<p>Sometimes clients have very specific requirements. Sometimes they want autometic controls on simple things they have total control over anyway.  I digress.</p>
	<p>In this case, blog titles needed to be of any length, but have their lengths truncated under certain circumstances.  Furthermore, excerpts need to be able to be the default length (50 words), but shorter (10 words) under those same certain circumstances.</p>
	<p>Fortunately for me, the excerpt was easily fixed using a plugin called <a href="http://guff.szub.net/2005/02/26/the-excerpt-reloaded/">the excerpt reloaded</a>.</p>
	<p>http://guff.szub.net/2005/02/26/the-excerpt-reloaded/</p>
	<p>Next, for the title length requirements, you will need to modifiy a core file: <code>wp-includes/post-template.php</code>.</p>
	<p>[php]<br />
function the_title($before = &#8216;&#8217;, $after = &#8216;&#8217;, $echo = true, $length = false) {
   $title = get_the_title();
    if ( $length &#38;&#38; is_numeric($length) ) {
       $title = substr( $title, 0, $length );
    }
    if ( strlen($title) > 0 ) {
       $title = apply_filters(&#8216;the_title&#8217;, $before . $title . $after, $before, $after);
       if ( $echo )
          echo $title;
       else
          return $title;
    }<br />
}<br />
[/php]</p>
	<p>Finally, when in <strong>The Loop</strong>, call the_title() like this:</p>
	<p>[php]< ?php the_title('', '', true, '40') ?>[/php]</p>
	<p>Now, the title will be a mere 40 characters long, and the excerpt (using <code>the_excerpt_reloaded()</code>) can be any desired length.</p>

 ]]></content:encoded>
			<wfw:commentRss>http://www.willoller.com/limiting-title-and-excerpt-length-with-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>CSS Sibling selectors</title>
		<link>http://www.willoller.com/css-sibling-selectors/</link>
		<comments>http://www.willoller.com/css-sibling-selectors/#comments</comments>
		<pubDate>Fri, 15 Dec 2006 04:27:50 +0000</pubDate>
		<dc:creator>will</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Web Standards]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.willoller.com/css-sibling-selectors/</guid>
		<description><![CDATA[For those of us who care about the semantic web, standards, or the W3C, The Web Standards Project needs to be in your feed reader. I&#8217;ll admt, it wasn&#8217;t in mine; until now that is. The design of the site is awesome, and they eat their own cooking. (Plus, they use WordPress!) They employ css [...]]]></description>
			<content:encoded><![CDATA[	<p>For those of us who care about the semantic web, standards, or the W3C, <a href="http://www.webstandards.org/" title="Permanent link to The Web Standards Project">The Web Standards Project</a> needs to be in your feed reader.  I&#8217;ll admt, it wasn&#8217;t in mine; until now that is.</p>
	<p>The design of the site is awesome, and they eat their own cooking.  (Plus, they use WordPress!)  They employ css tricks I have seldom seen used before, and consistently use semantic tags (<code>&lt;abbr&gt;</code>, <code>&lt;q&gt;</code>).</p>
	<p>The best trick of all: the sibling selector.  Why?  Because it allows for truly semantic output with the leanest markup possible.  Before, I might have marked up a simple content block like this:<br />
<pre><br />
<code><br />
&lt;div class="content"&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;h1&gt;Title&lt;/h1&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;img src="url" alt="pic related to story"&gt;<br />
&#160;&#160; &lt;div class="block"&gt;&lt;br /&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&lt;p class="intro"&gt;This is an introduction sentance or paragraph.&#160;&#160;It is supposed to represent a blurb about the article below.&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&lt;div class="mainbody"&gt;&lt;br /&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p&gt;content&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p&gt;content&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p&gt;content&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;p&gt;content&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&lt;/div&gt;&lt;br /&gt;<br />
&#160;&#160;&#160;&#160;&#160;&#160;&lt;p class="footer"&gt;Footer.&#160;&#160;Date or links, or whatever.&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;/div&gt;&lt;br /&gt;<br />
&lt;/div&gt;<br />
</code><br />
</pre><br />
This way, all of the elements have class hooks.  CSS is applied using the classes and simple hierarchies:<br />
<pre><br />
<code><br />
div.content { }<br />
div.content h1 { font-size:1.8em; }<br />
div.content div.block { border:1px solid black; }<br />
div.block p.intro { font-weight: bold; }<br />
div.block img { float:right; }<br />
div.block div.mainbody { clear: both; }<br />
div.mainbody p { color: #006; }<br />
p.footer { font-size: 0.7em; color: #888; }<br />
</code><br />
</pre><br />
Class hooks are helpful, but not really needed if you use sibling selectors!  You, too, can write super-styled code without the additional markup headache!<br />
<pre><br />
<code><br />
&lt;div class="content" &gt;&lt;br /&gt;<br />
&#160;&#160; &lt;h1&gt;Title&lt;/h1&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;img src="url" alt="That image again"/&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;p&gt;This is an introduction sentance or paragraph.&#160;&#160;It is supposed to represent a blurb about the article below.&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;p&gt;content&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;p&gt;content&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;p&gt;content&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;p&gt;content&lt;/p&gt;&lt;br /&gt;<br />
&#160;&#160; &lt;p class="footer"&gt;Footer.&#160;&#160;Date or links, or whatever.&lt;/p&gt;&lt;br /&gt;<br />
&lt;/div&gt;<br />
</code><br />
</pre><br />
See, that code is cleaner and easier to maintain.  The CSS required to <br />
<pre><br />
<code><br />
div.content { }<br />
div.content h1 { font-size:1.8em; }<br />
div.content p { color: #006; }<br />
div.content h1+p { color: #000; font-weight: bold; clear:both;}<br />
div.content h1+img { float:right; }<br />
div.content img { float:left } /* Just for fun */<br />
div.content p.footer { font-size: 0.7em; color: #888; }<br />
</code></p>
	<p>That&#8217;s all there is to it.  Now, the line between content and design is darkened.</p>
	<p>One thing: the class hook remains on the footer element.  This is because adjacent-sibling selectors do not work in reverse.  The selector applies only to the element after the <code>+</code>, and there is no selector that applies to a previous adjacent-sibling element.</p>
	<p><h3>Sources</h3><br />
<a href="http://meyerweb.com/eric/articles/webrev/200007a.html">Eric Myer wrote about them</a>.<br />
<a href="http://www.w3.org/TR/REC-CSS2/selector.html">The W3C recommends them</a>.<br />
<a href="http://www.communitymx.com/content/article.cfm?cid=1C603">John Gallant and Holly Bergevin say IE7 supports them</a>.</pre></p>

 ]]></content:encoded>
			<wfw:commentRss>http://www.willoller.com/css-sibling-selectors/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

