<?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>Blogging Squared</title>
	<atom:link href="http://bloggingsquared.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://bloggingsquared.com</link>
	<description>Blogging Squared provides custom blog design for small businesses.</description>
	<lastBuildDate>Thu, 09 Feb 2012 05:13:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>Make Shortcodes Work in all WordPress Post Excerpts</title>
		<link>http://bloggingsquared.com/blogging-tips/make-shortcodes-work-in-all-wordpress-post-excerpts/</link>
		<comments>http://bloggingsquared.com/blogging-tips/make-shortcodes-work-in-all-wordpress-post-excerpts/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 05:13:32 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Blogging Tips]]></category>
		<category><![CDATA[Plugins]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://bloggingsquared.com/?p=550</guid>
		<description><![CDATA[Need your shortcodes to render when displaying post excerpts? This snippet does just that, regardless of whether the excerpt is manually set or automatically generated. First, we need to unregister a WordPress core filter and register our own slightly modified version. Add the following lines of code to your plugin file or functions.php file. remove_filter&#40;'get_the_excerpt', [...]]]></description>
			<content:encoded><![CDATA[<p>Need your shortcodes to render when displaying post excerpts? This snippet does just that, regardless of whether the excerpt is manually set or automatically generated.</p>
<p>First, we need to unregister a WordPress core filter and register our own slightly modified version. </p>
<p>Add the following lines of code to your plugin file or functions.php file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">remove_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'wp_trim_excerpt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_the_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'custom_trim_excerpt'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next we copy and paste the function &#8220;wp_trim_excerpt&#8221; from &#8220;wp-includes/formatting.php&#8221; into our file and rename it to &#8220;custom_trim_excerpt&#8221;.</p>
<p>Now just comment out the line that calls &#8220;strip_shortcodes&#8221; so it looks like the code below.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> custom_trim_excerpt<span style="color: #009900;">&#40;</span><span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$raw_excerpt</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$text</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$text</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> get_the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">//$text = strip_shortcodes( $text );</span>
&nbsp;
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'the_content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">']]&amp;gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">']]&amp;gt;'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$excerpt_length</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'excerpt_length'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">55</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$excerpt_more</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'excerpt_more'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">' '</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'[...]'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> wp_trim_words<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$excerpt_length</span><span style="color: #339933;">,</span> <span style="color: #000088;">$excerpt_more</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #b1b100;">return</span> apply_filters<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_trim_excerpt'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #339933;">,</span> <span style="color: #000088;">$raw_excerpt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>The last step is to make sure all the excerpts (manual and automatic) are run through the &#8220;do_shortcode&#8221; function. Add the line below and you are good to go!</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'get_the_excerpt'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'do_shortcode'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/blogging-tips/make-shortcodes-work-in-all-wordpress-post-excerpts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a second blog page to your WordPress site</title>
		<link>http://bloggingsquared.com/web-development/adding-an-alternate-blog-page-to-your-wordpress-site/</link>
		<comments>http://bloggingsquared.com/web-development/adding-an-alternate-blog-page-to-your-wordpress-site/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 20:36:08 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://bloggingsquared.com/?p=534</guid>
		<description><![CDATA[I recently received a request from a client who wanted to have their WordPress loop visible on the home page as well as on a &#8220;blog&#8221; page. The posts that would be displayed on the home page would be slightly different from those on the blog page. The desired effect can be achieved using the [...]]]></description>
			<content:encoded><![CDATA[<p>I recently received a request from a client who wanted to have their WordPress loop visible on the home page as well as on a &#8220;blog&#8221; page. The posts that would be displayed on the home page would be slightly different from those on the blog page.</p>
<p>The desired effect can be achieved using the following process.</p>
<p>First, duplicate the your default loop template file, usually index.php and rename it to blog-page.php</p>
<p>At the top of this file, insert this comment so that any static page can use this template file by setting the template drop down by editing the page in the WordPress dashboard.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
 	<span style="color: #666666; font-style: italic;">/*  	Template Name: Blog Page    */</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Next set up an alternate post query in the template file by creating a new instance of WP_Query. This is a better approach than calling query_posts(), since query_posts() alters the global query variables, which will have some undesirable results( e.g. your &#8220;blog&#8221; page won&#8217;t get the current-menu-item class applied to it in the navigation, so the link item can&#8217;t be highlighted).</p>
<p>Use the code below to create a new instance of WP_Query. Pass in the following default query vars so that post paging works correctly. It might also be helpful to run your alternate query variables through a filter, so you can hook into this query in a plugin or in the functions.php file and further customize it.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
&nbsp;
<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$paged</span><span style="color: #339933;">;</span> 
<span style="color: #000088;">$alternate_blog_query_vars</span> <span style="color: #339933;">=</span> apply_filters<span style="color: #009900;">&#40;</span>
 	<span style="color: #0000ff;">'alternate_blog_query_vars'</span><span style="color: #339933;">,</span>
 	<span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
 		<span style="color: #0000ff;">'posts_per_page'</span><span style="color: #339933;">=&gt;</span>get_option<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'posts_per_page'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
		<span style="color: #0000ff;">'paged'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$paged</span>
	<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$alternate_query</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$alternate_blog_query_vars</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Next, alter the loop functions to use the $alternate_query instead of the main query. Look for the calls to have_posts(), and the_post(), and change them so it looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> 
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$alternate_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span>
&nbsp;
	<span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$alternate_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$alternate_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #339933;">&lt;!--</span> loop code goes in here <span style="color: #339933;">--&gt;</span>
&nbsp;
	<span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>That should just about do it. You can now set any page in your WordPress website to display the posts that would normally appear only only the home page. You can also use the filter &#8216;alternate_blog_query_vars&#8217; to modify the posts that are shown on these pages.</p>
<p>The only problem I ran into with this approach is that the wp-paginate plugin wouldn&#8217;t recognize that this post needed to be paginated, because it only considers the main loop when it is rendering its pagination buttons. I fixed this by temporarily making my custom query the main query, then resetting it once the pagination was rendered so that nothing would break further down in the code.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'wp_paginate'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 	<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">;</span>
  	<span style="color: #000088;">$tmp_query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$wp_query</span><span style="color: #339933;">;</span> 
	<span style="color: #000088;">$wp_query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$alternate_query</span><span style="color: #339933;">;</span>	
	wp_paginate<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$wp_query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$tmp_query</span><span style="color: #339933;">;</span>
 <span style="color: #009900;">&#125;</span>  
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Easy as pie!</p>
]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/web-development/adding-an-alternate-blog-page-to-your-wordpress-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make My Blog Honest Tutorial Plugin</title>
		<link>http://bloggingsquared.com/plugins/word11demo/</link>
		<comments>http://bloggingsquared.com/plugins/word11demo/#comments</comments>
		<pubDate>Sun, 06 Nov 2011 12:36:48 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Plugins]]></category>

		<guid isPermaLink="false">http://bloggingsquared.com/?p=527</guid>
		<description><![CDATA[Hey all! Thanks for attending my presentation. Here are some additional resources for you: Presentation Slides &#8211; (keynote slides, pdf) Make My Blog Honest Plugin Page Advanced PHP by George Shlossnagle]]></description>
			<content:encoded><![CDATA[<p>Hey all! Thanks for attending my presentation. Here are some additional resources for you:</p>
<ul>
<li>Presentation Slides &#8211; (<a href="http://bloggingsquared.com/downloads/Presentation.key">keynote slides</a>, <a href="http://bloggingsquared.com/downloads/Presentation.pdf">pdf</a>)</li>
<li><a href="http://wordpress.org/extend/plugins/make-my-blog-honest/">Make My Blog Honest Plugin Page</a></li>
<li><a href="http://www.amazon.ca/Advanced-PHP-Programming-George-Schlossnagle/dp/0672325616">Advanced PHP by George Shlossnagle</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/plugins/word11demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to add the current menu item CSS class to a custom link in a WordPress menu</title>
		<link>http://bloggingsquared.com/blogging-tips/how-to-add-the-current-menu-item-css-class-to-a-custom-link-in-a-wordpress-menu/</link>
		<comments>http://bloggingsquared.com/blogging-tips/how-to-add-the-current-menu-item-css-class-to-a-custom-link-in-a-wordpress-menu/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 17:09:57 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Blogging Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://bloggingsquared.com/?p=517</guid>
		<description><![CDATA[So the new WordPress menus introduced in 3.0 are great but the Menus panel of the WordPress Dashboard limits us in what we can add to our menus. If, for example, we want to add archive pages for custom post types we end up having to add them as &#8220;Custom Links&#8221;. This is an easy [...]]]></description>
			<content:encoded><![CDATA[<p>So the new WordPress menus introduced in 3.0 are great but the Menus panel of the WordPress Dashboard limits us in what we can add to our menus. If, for example, we want to add archive pages for custom post types we end up having to add them as &#8220;Custom Links&#8221;. This is an easy work-around, but doing this robs us of the ability to highlight the current menu item when a user is viewing this page.</p>
<p>Here is a simple hack that you can add to your themes functions.php file, or build into your plug-in in order to identify when a &#8220;Custom Link&#8221; page is active, and add the &#8220;current-menu-item&#8221; class.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'nav_menu_css_class'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'AddCurrentMenuItemClass'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> AddCurrentMenuItemClass<span style="color: #009900;">&#40;</span><span style="color: #000088;">$classes</span><span style="color: #339933;">,</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> site_url<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #339933;">,</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</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: #000088;">$classes</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'current-menu-item'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$classes</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>If you don&#8217;t want the menu item to get the current-menu-item class when viewing a sub-page, use the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_filter<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'nav_menu_css_class'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'AddCurrentMenuItemClass'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> AddCurrentMenuItemClass<span style="color: #009900;">&#40;</span><span style="color: #000088;">$classes</span><span style="color: #339933;">,</span><span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$link</span> <span style="color: #339933;">=</span> site_url<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_URI'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strcmp</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link</span><span style="color: #339933;">,</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">url</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$classes</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'current-menu-item'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">return</span> <span style="color: #000088;">$classes</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Make sure the url for the Custom Link matches the format of the $link variable. That is to say, it should be the full site_url (you can find out this value by looking at Settings &gt; General in the WordPress Dashboard) followed by your archive page slug.</p>
]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/blogging-tips/how-to-add-the-current-menu-item-css-class-to-a-custom-link-in-a-wordpress-menu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>See us speak at Word11 in Toronto</title>
		<link>http://bloggingsquared.com/wordpress/see-us-speak-at-word11-in-toronto/</link>
		<comments>http://bloggingsquared.com/wordpress/see-us-speak-at-word11-in-toronto/#comments</comments>
		<pubDate>Fri, 12 Aug 2011 13:54:42 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Events]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://bloggingsquared.com/?p=507</guid>
		<description><![CDATA[Come check out the Word11 24 hour blogging festival going down in Toronto on August 27th where I&#8217;ll be giving a talk on intermediate WordPress plugin development. From now until August 24th you can register and use the code SPEAKERS11 for a 50% discount. Learn more at http://word11.com]]></description>
			<content:encoded><![CDATA[<p><a href="http://word11.com"><img class="size-full wp-image-508 alignleft" title="inner-word11logo-colorful" src="http://bloggingsquared.com/wp-content/uploads/2011/08/inner-word11logo-colorful.png" alt="" width="220" height="109" /></a>Come check out the Word11 24 hour blogging festival going down in Toronto on August 27th where I&#8217;ll be giving a talk on intermediate WordPress plugin development.</p>
<p>From now until August 24th you can register and use the code <strong>SPEAKERS11</strong> for a 50% discount. Learn more at <a href="http://word11.com">http://word11.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/wordpress/see-us-speak-at-word11-in-toronto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>flipCounter, our contest countdown jQuery plugin</title>
		<link>http://bloggingsquared.com/showcase/flipcounter-jquery-plugin/</link>
		<comments>http://bloggingsquared.com/showcase/flipcounter-jquery-plugin/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 18:52:13 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Showcase]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://bloggingsquared.com/?p=496</guid>
		<description><![CDATA[On our most recent project, we held an online giveaway where the first 100 entrants would win a free bag of coffee. In designing the signup form, I really wanted to present the user with a nice visual counter that would show the user exactly how many samples were still up for grabs. Nothing spurs [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-medium wp-image-497 alignright" title="Groupon - Time left to buy" src="http://bloggingsquared.com/wp-content/uploads/2011/03/Screen-shot-2011-03-17-at-2.32.44-PM-300x185.png" alt="Groupon - Time left to buy" width="300" height="185" />On our most recent project, we held an online giveaway where the first 100 entrants would win a free bag of coffee. In designing the signup form, I really wanted to present the user with a nice visual counter that would show the user exactly how many samples were still up for grabs. Nothing spurs users into action more then a deal that&#8217;s going to expire, and nothing gives users more confidence than knowing that they aren&#8217;t the only ones that have signed up. The success of this philosophy can clearly be seen on sites like Groupon. So I set off building a nice countdown graphic drawing inspiration from my cars odometer, analogue clocks and retro webpage hit-counters.</p>
<p><a href="http://bloggingsquared.com/wp-content/uploads/2011/03/Screen-shot-2011-03-14-at-11.37.54-AM.png"><img class="alignleft size-medium wp-image-498" title="Screen shot 2011-03-14 at 11.37.54 AM" src="http://bloggingsquared.com/wp-content/uploads/2011/03/Screen-shot-2011-03-14-at-11.37.54-AM-300x212.png" alt="" width="300" height="212" /></a>Once I had my graphic designed, I thought I&#8217;d invoke a little jQuery to give it some pizzaz. I banged out the script in a few minutes and it was good to go. We launched the site, hit Facebook, Twitter and the Aurora Importing blog and waited for the traffic to roll in.</p>
<p>It took some time for us to get our first sign ups. In fact on the first day, the form sat completely untouched. If we were to run this contest again, I think I would avoid starting off the contest at an even number. When you see &#8220;100 samples available&#8221;, people tend to assume the counter is simply non functional, rather than believe they are actually the first person to sign up. It&#8217;s also scary being the first person through the door. What if you get ripped off? What if you&#8217;re the only one that falls for it?</p>
<p>On day two John did some digging and found some interesting forums, twitter accounts and deal websites to mention the contest too. Not long after I started seeing the counter tick down to zero, a within about an hour and a half, it was all over!</p>
<p>I had a look at my jQuery code, and seeing that rest of the week wasn&#8217;t looking to busy, I set off inspired to write my first legit jQuery plugin. I &#8216;plugged in&#8217; (to borrow a term from &#8220;The Social Network&#8221;), and before I knew it, it was all done!</p>
<p>If you&#8217;ve got a minute, <a title="flipCounter - a jQuery plugin by BloggingSquared.com" href="http://bloggingsquared.com/jquery/flipcounter">check out flipCounter</a>, BloggingSquared&#8217;s first jQuery plugin, and let us know what you think!</p>
<p><a href="http://bloggingsquared.com/wp-content/uploads/2011/03/Screen-shot-2011-03-17-at-2.47.46-PM.png"><img class="aligncenter size-medium wp-image-499" title="flipCounter - a jQuery counter plugin" src="http://bloggingsquared.com/wp-content/uploads/2011/03/Screen-shot-2011-03-17-at-2.47.46-PM-300x226.png" alt="flipCounter - a jQuery counter plugin" width="300" height="226" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/showcase/flipcounter-jquery-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aurora Espresso Coffee Landing Page</title>
		<link>http://bloggingsquared.com/case-study/aurora-espresso-coffee/</link>
		<comments>http://bloggingsquared.com/case-study/aurora-espresso-coffee/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 18:23:51 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Case Study]]></category>

		<guid isPermaLink="false">http://bloggingsquared.com/?p=490</guid>
		<description><![CDATA[Recently we&#8217;ve been working with Aurora Importing helping them promote their new line of espresso coffees. We wanted to put together a landing page that would serve as an online brochure and act as a landing page for various social media marketing campaigns. The page would be designed to provide users with basic information about [...]]]></description>
			<content:encoded><![CDATA[<p>Recently we&#8217;ve been working with Aurora Importing helping them promote their new line of espresso coffees. We wanted to put together a landing page that would serve as an online brochure and act as a landing page for various social media marketing campaigns. The page would be designed to provide users with basic information about the product at a glance, and give them a tool for finding the nearest store where they could buy the product.</p>
<p><a href="http://coffee.auroraimporting.com"><img class="alignleft size-medium wp-image-492" title="Aurora Espresso Coffee Website" src="http://bloggingsquared.com/wp-content/uploads/2011/03/Screen-shot-2011-03-17-at-2.19.44-PM-268x300.png" alt="Aurora Espresso Coffee Website" width="268" height="300" /></a>Building a landing page is a lot of fun.You&#8217;re afforded the flexibility of not having to build the page within the architecture of the parent page, so you can focus on making the page clean, concise and functional. Large images, prominent calls to action and a clear information architecture are all friends of the landing page.</p>
<p>The Aurora Espresso Coffee landing page is part of a year long strategy that we&#8217;ve developed with Aurora Importing, designed to help them build a strong online community of loyal customers who share a passion for quality food products. <a title="Visit Aurora's espresso coffee landing page" href="http://coffee.auroraimporting.com">Check out the page</a> and let us know what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/case-study/aurora-espresso-coffee/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WordPress Template Plugin for Learning Advanced Plugin Techniques</title>
		<link>http://bloggingsquared.com/web-development/wordpress-template-plugin-for-learning-advanced-techniques/</link>
		<comments>http://bloggingsquared.com/web-development/wordpress-template-plugin-for-learning-advanced-techniques/#comments</comments>
		<pubDate>Tue, 18 Jan 2011 15:37:00 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://bloggingsquared.com/?p=481</guid>
		<description><![CDATA[It&#8217;s been less than a year since I first published my B2Template plugin to help people start building their own plugins for WordPress. I received some great feedback and so I&#8217;ve updated the plugin to address some new features in WordPress 3, and improve on some of the methods I took in the previous version. [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been less than a year since I first published my <a title="View the post covering the previous version of the B2Template Plugin" href="http://bloggingsquared.com/web-development/brolly-template-plugin/">B2Template plugin to help people start building their own plugins for WordPress</a>. I received some great feedback and so I&#8217;ve updated the plugin to address some new features in WordPress 3, and improve on some of the methods I took in the previous version. The new version of the <a title="Go to the WordPress Plugin Directory to download the B2Template Plugin" href="http://wordpress.org/extend/plugins/brolly-wordpress-plugin-template/">B2Template Plugin is available from the WordPress Plugin directory</a>. The plugin has been commented to within an inch of its life, and is hopefully laid out in a way that is easy to follow.</p>
<p>This plugin covers the following topics:</p>
<ul>
<li>Creating a Plugin within a class structure to better encapsulate your plugin and avoid conflicts with other plugins</li>
<li>Creating actions and filters</li>
<li>Creating an install script that runs on plugin activation and deactivation, and also performing the important step of removing all traces of your plugin upon deletion.</li>
<li>Internationalizing your plugin so that it can be translated by the WordPress community, and also how to create language files</li>
<li>Creating administration pages, registering settings, saving settings, properly loading JavaScript and CSS into admin pages, adding a link to the plugins settings page on the plugin activation page.</li>
<li>Using action and filters</li>
<li>Executing actions with and without Ajax from user-facing and admin-facing pages in a clean consistent manner.</li>
<li>How to load Ajax Elements</li>
<li>Registering and creating a WordPress 3.0 multi-widget</li>
<li>Interacting with the database, proper input sanitization</li>
<li>Returning error messages to the user with the WP_Error object</li>
</ul>
<p>Please check out the plugin and let me know if you find it helpful, or if you can think of ways in which it can be improved.</p>
<p><a title="Go to the WordPress Plugin Directory to download the B2Template Plugin" href="http://wordpress.org/extend/plugins/brolly-wordpress-plugin-template/">Download the B2Template Plugin 2.0 from the WordPress Plugin Directory</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/web-development/wordpress-template-plugin-for-learning-advanced-techniques/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Widget to Translate Blog Link Categories with WPML</title>
		<link>http://bloggingsquared.com/web-development/widget-to-translate-blog-link-categories-with-wpml/</link>
		<comments>http://bloggingsquared.com/web-development/widget-to-translate-blog-link-categories-with-wpml/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 16:14:52 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://brolly.ca/?p=406</guid>
		<description><![CDATA[I&#8217;ve been using the WPML plugin on a few sites recently to turn WordPress into a very powerful multilingual CMS, with great success. I really have to applaud these guys for building a very useful plugin. On the to-do list is integrating their plug-in with WordPress&#8217; built-in widgets. A few people have mentioned getting stuck [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the WPML plugin on a few sites recently to turn WordPress into a very powerful multilingual CMS, with great success. I really have to applaud these guys for building a very useful plugin. On the to-do list is integrating their plug-in with WordPress&#8217; built-in widgets. A few people have mentioned getting stuck when trying to use the Links feature of WordPress, which does not currently work with WPML.</p>
<p>To fix this issue, I&#8217;ve thrown together a quick widget that acts as a wrapper for WordPress&#8217; built-in widget, but lets you set a different link category for each language you have setup using WPML. I hope you find this useful.</p>
<p>To install, copy and paste this into your theme&#8217;s function.php file or insert code into a file in the plugins directory.</p>
<p><strong>* NOTE &#8211; This code may be out of date. Please try commenter <a href="http://pastebin.com/e3g32sdj">Loic&#8217;s solution here</a> if the code below does not work properly.</strong><br/><br />
<strong>* NOTE &#8211; Commenter Uli has also improved this plugin and extended it in a similar way to translate RSS Feeds. Visit barcelonabudget.es for more info.</strong></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'widgets_init'</span><span style="color: #339933;">,</span>  <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'LinkTranslationWidget'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">'register_widget'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> LinkTranslationWidget <span style="color: #000000; font-weight: bold;">extends</span> WP_Widget
<span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> LinkTranslationWidget<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">/* Widget settings. */</span>
		<span style="color: #000088;">$widget_ops</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'classname'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #0000ff;">'LinkTranslationWidget'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'This widget allows you to set different link categories to display based on a language setting.'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>plugin_name<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">/* Widget control settings. */</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">/* Create the widget. */</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>WP_Widget<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'LinkTranslationWidget'</span><span style="color: #339933;">,</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WPML Links'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$widget_ops</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> register_widget<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		register_widget<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'LinkTranslationWidget'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> widget<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$args</span><span style="color: #339933;">,</span> <span style="color: #000088;">$instance</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$sitepress</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">class_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'WP_Widget_Links'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #000088;">$link_widget</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Widget_Links<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sitepress</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #009900;">&#123;</span>
&nbsp;
				<span style="color: #000088;">$lang</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$sitepress</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get_current_language<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'category'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$lang</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'_category'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$link_widget</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>widget<span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #339933;">,</span> <span style="color: #000088;">$instance</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> update<span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_instance</span><span style="color: #339933;">,</span> <span style="color: #000088;">$old_instance</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$new_instance</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$new_instance</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$instance</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'images'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'name'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'description'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'rating'</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</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;">$instance</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$field</span> <span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #000088;">$val</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_instance</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
				<span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$field</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000088;">$langs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>GetLangs<span style="color: #009900;">&#40;</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;">$langs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$lang</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$lang_id</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$instance</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$lang</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'_category'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$new_instance</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$lang</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'_category'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$instance</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> form<span style="color: #009900;">&#40;</span><span style="color: #000088;">$instance</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #000088;">$settings</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>GetSettings<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$langs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>GetLangs<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$instance</span> <span style="color: #339933;">=</span> wp_parse_args<span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#41;</span> <span style="color: #000088;">$instance</span><span style="color: #339933;">,</span> <span style="color: #000088;">$settings</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$link_cats</span> <span style="color: #339933;">=</span> get_terms<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'link_category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$langs</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$lang</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$lang_id</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&nbsp;
&lt;label for=&quot;'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get_field_id<span style="color: #009900;">&#40;</span><span style="color: #000088;">$lang</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'_category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">.</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Select Link Category'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' ('</span> <span style="color: #339933;">.</span><span style="color: #000088;">$lang</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'): &lt;/label&gt;'</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;select id=&quot;'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get_field_id<span style="color: #009900;">&#40;</span><span style="color: #000088;">$lang</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'_category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot; name=&quot;'</span><span style="color: #339933;">.</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get_field_name<span style="color: #009900;">&#40;</span><span style="color: #000088;">$lang</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'_category'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span> <span style="color: #000088;">$link_cats</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$link_cat</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
				<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'
&lt;option value=&quot;'</span> <span style="color: #339933;">.</span> <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$link_cat</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>term_id<span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot;&gt;term_id == $instance[$lang.'</span>_category<span style="color: #0000ff;">'] ? '</span> selected<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;selected&quot;</span><span style="color: #0000ff;">' : '</span><span style="color: #0000ff;">' )
				. '</span><span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #0000ff;">' . $link_cat-&amp;gt;name . &quot;&lt;/option&gt;
&nbsp;
\n&quot;;
			}
			echo '</span><span style="color: #339933;">&lt;/</span>select<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #0000ff;">';
&nbsp;
		}
		?&amp;gt;
&lt;input class=&quot;checkbox&quot; type=&quot;checkbox&quot; /&gt; id=&quot;&lt;!--?php echo $this---&gt;get_field_id('</span>images<span style="color: #0000ff;">'); ?&amp;gt;&quot; name=&quot;&lt;!--?php echo $this---&gt;get_field_name('</span>images<span style="color: #0000ff;">'); ?&amp;gt;&quot; /&amp;gt;
		&lt;label for=&quot;&amp;lt;?php echo $this-&amp;gt;get_field_id('</span>images<span style="color: #0000ff;">'); ?&amp;gt;&quot;&gt;&lt;!--?php _e('</span>Show <span style="color: #990000;">Link</span> Image<span style="color: #0000ff;">'); ?--&gt;&lt;/label&gt;
&lt;input class=&quot;checkbox&quot; type=&quot;checkbox&quot; /&gt; id=&quot;&lt;!--?php echo $this---&gt;get_field_id('</span>name<span style="color: #0000ff;">'); ?&amp;gt;&quot; name=&quot;&lt;!--?php echo $this---&gt;get_field_name('</span>name<span style="color: #0000ff;">'); ?&amp;gt;&quot; /&amp;gt;
		&lt;label for=&quot;&amp;lt;?php echo $this-&amp;gt;get_field_id('</span>name<span style="color: #0000ff;">'); ?&amp;gt;&quot;&gt;&lt;!--?php _e('</span>Show <span style="color: #990000;">Link</span> Name<span style="color: #0000ff;">'); ?--&gt;&lt;/label&gt;
&lt;input class=&quot;checkbox&quot; type=&quot;checkbox&quot; /&gt; id=&quot;&lt;!--?php echo $this---&gt;get_field_id('</span>description<span style="color: #0000ff;">'); ?&amp;gt;&quot; name=&quot;&lt;!--?php echo $this---&gt;get_field_name('</span>description<span style="color: #0000ff;">'); ?&amp;gt;&quot; /&amp;gt;
		&lt;label for=&quot;&amp;lt;?php echo $this-&amp;gt;get_field_id('</span>description<span style="color: #0000ff;">'); ?&amp;gt;&quot;&gt;&lt;!--?php _e('</span>Show <span style="color: #990000;">Link</span> Description<span style="color: #0000ff;">'); ?--&gt;&lt;/label&gt;
&lt;input class=&quot;checkbox&quot; type=&quot;checkbox&quot; /&gt; id=&quot;&lt;!--?php echo $this---&gt;get_field_id('</span>rating<span style="color: #0000ff;">'); ?&amp;gt;&quot; name=&quot;&lt;!--?php echo $this---&gt;get_field_name('</span>rating<span style="color: #0000ff;">'); ?&amp;gt;&quot; /&amp;gt;
		&lt;label for=&quot;&amp;lt;?php echo $this-&amp;gt;get_field_id('</span>rating<span style="color: #0000ff;">'); ?&amp;gt;&quot;&gt;&lt;!--?php _e('</span>Show <span style="color: #990000;">Link</span> Rating<span style="color: #0000ff;">'); ?--&gt;&lt;/label&gt;
&nbsp;
		&lt;!--?php 	} 	function GetLangs() 	{ 		global $sitepress_settings; 		$langs = $sitepress_settings['</span>default_categories<span style="color: #0000ff;">']; 		return $langs; 	} 	function GetSettings() 	{ 		$settings = array(); 		$settings['</span>images<span style="color: #0000ff;">'] = true; 		$settings['</span>name<span style="color: #0000ff;">'] = true; 		$settings['</span>description<span style="color: #0000ff;">'] = false; 		$settings['</span>rating<span style="color: #0000ff;">'] = false; 		$langs = $this---&gt;GetLangs();
		foreach($langs as $lang=&amp;gt;$lang_id)
		{
			$settings[$lang.'</span>_category<span style="color: #0000ff;">'] = '</span><span style="color: #0000ff;">';
		}
		return $settings;
	}
&nbsp;
}</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/web-development/widget-to-translate-blog-link-categories-with-wpml/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Use TinyMCE in your WordPress 2.8 Plugin</title>
		<link>http://bloggingsquared.com/web-development/use-tinymce-in-your-wordpress-28-plugin/</link>
		<comments>http://bloggingsquared.com/web-development/use-tinymce-in-your-wordpress-28-plugin/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 16:44:08 +0000</pubDate>
		<dc:creator>dan.imbrogno</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://brolly.ca/?p=400</guid>
		<description><![CDATA[Okay, so when you try to include the tinyMCE code using wordpress&#8217; built in wp_enqueue_script() function, it does absolutely nothing. If you try to manually include the script, you&#8217;ll end up with all sorts of javascript errors, and missing language translations. However, if you simply call wp_tiny_mce(); in the template_redirect or wp_head function, all the [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, so when you try to include the tinyMCE code using wordpress&#8217; built in wp_enqueue_script() function, it does absolutely nothing. If you try to manually include the script, you&#8217;ll end up with all sorts of javascript errors, and missing language translations. However, if you simply call wp_tiny_mce(); in the template_redirect or wp_head function, all the javascript for tiny_mce is loaded properly. Then all you need to do, is run your tinymce.init script to setup your text editor. For example:</p>
<p><code><br />
<script type="text/javascript">// <![CDATA[
		/* <! [CDATA[ */
		tinyMCE.init({
		theme : "advanced",
		mode : "exact",
		elements : "Cinemon_extra",
		width : "565",
		height : "200",</p>
<p>		});
		/*
 */
//  &gt;
// ]]&gt;</script><br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://bloggingsquared.com/web-development/use-tinymce-in-your-wordpress-28-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

