<?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>Web Development</title> <atom:link href="http://onemanonelaptop.com/feed/" rel="self" type="application/rss+xml" /><link>http://onemanonelaptop.com</link> <description></description> <lastBuildDate>Tue, 10 Jan 2012 20:52:54 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>Using Multiple Titles In a WordPress Widget</title><link>http://onemanonelaptop.com/multiple-titles-in-a-wordpress-widget/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=multiple-titles-in-a-wordpress-widget</link> <comments>http://onemanonelaptop.com/multiple-titles-in-a-wordpress-widget/#comments</comments> <pubDate>Mon, 19 Sep 2011 18:11:36 +0000</pubDate> <dc:creator>Rob</dc:creator> <category><![CDATA[Code]]></category> <category><![CDATA[Wordpress]]></category><guid
isPermaLink="false">http://onemanonelaptop.com/?p=1148</guid> <description><![CDATA[Today I needed a way to add more than one line of text for a widget heading, each line of text also needed to be styled in a different way. Here is what I came up with as a solution. Basically inserting three semicolons in a row inside a widgets title splits the content either [...]]]></description> <content:encoded><![CDATA[<p>Today I needed a way to add more than one line of text for a widget heading, each line of text also needed to be styled in a different way. Here is what I came up with as a solution.</p><p>Basically inserting three semicolons in a row inside a widgets title splits the content either side of the semicolons into their own span elements with their own class name.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> multiple_widget_title<span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #666666; font-style: italic;">// Set a string of characters to use as the break point. </span>
	<span style="color: #000088;">$breakat</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;:::&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #666666; font-style: italic;">// check if the break point exists in the title	</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">strrpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$title</span><span style="color: #339933;">,</span>  <span style="color: #000088;">$breakat</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> 
		<span style="color: #b1b100;">return</span>  <span style="color: #000088;">$title</span><span style="color: #339933;">;</span>		
	<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$counter</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$output</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$split</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$breakat</span><span style="color: #339933;">,</span><span style="color: #000088;">$title</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$split</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$chunk</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$output</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">'&lt;span class=&quot;widget-title-'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$counter</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$chunk</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&lt;/span&gt;'</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$counter</span><span style="color: #339933;">++;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$output</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'widget_title'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'multiple_widget_title'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://onemanonelaptop.com/multiple-titles-in-a-wordpress-widget/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Add a Span To WordPress Navigation Menu Items</title><link>http://onemanonelaptop.com/add-a-span-element-to-wordpress-navigation-menu-items/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=add-a-span-element-to-wordpress-navigation-menu-items</link> <comments>http://onemanonelaptop.com/add-a-span-element-to-wordpress-navigation-menu-items/#comments</comments> <pubDate>Mon, 19 Sep 2011 13:32:28 +0000</pubDate> <dc:creator>Rob</dc:creator> <category><![CDATA[Wordpress]]></category><guid
isPermaLink="false">http://onemanonelaptop.com/?p=1140</guid> <description><![CDATA[// Filter wp_nav_menu() to add an additional span element function span_nav_menu_items&#40;$items&#41; &#123; return preg_replace&#40;'@\&#60;li([^&#62;]*)&#62;\&#60;a([^&#62;]*)&#62;(.*?)\&#60;\/a&#62;@i', '&#60;li$1&#62;&#60;a$2&#62;&#60;span&#62;$3&#60;/span&#62;&#60;/a&#62;',$items&#41;; &#125; add_filter&#40; 'wp_nav_menu_items', 'span_nav_menu_items' &#41;;]]></description> <content:encoded><![CDATA[<div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Filter wp_nav_menu() to add an additional span element</span>
<span style="color: #000000; font-weight: bold;">function</span> span_nav_menu_items<span style="color: #009900;">&#40;</span><span style="color: #000088;">$items</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #b1b100;">return</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'@\&lt;li([^&gt;]*)&gt;\&lt;a([^&gt;]*)&gt;(.*?)\&lt;\/a&gt;@i'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;li$1&gt;&lt;a$2&gt;&lt;span&gt;$3&lt;/span&gt;&lt;/a&gt;'</span><span style="color: #339933;">,</span><span style="color: #000088;">$items</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
add_filter<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'wp_nav_menu_items'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'span_nav_menu_items'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://onemanonelaptop.com/add-a-span-element-to-wordpress-navigation-menu-items/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced
Database Caching 1/19 queries in 0.078 seconds using disk: basic
Object Caching 342/395 objects using disk: basic

Served from: onemanonelaptop.com @ 2012-02-23 03:42:01 -->
